Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Is it possible to make an autoplaylist... (Read 5419 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Is it possible to make an autoplaylist...

Always wondered this. Would certainly make my life easier for finding tracks I've yet to see any for!

Is it possible to make an autoplaylist...

Reply #1
and albumart is embedded?
or stored in artists folder?
or in another folder?

Is it possible to make an autoplaylist...

Reply #2
It'll be either in the same folder as the track or potentially embedded in the file if it's an MP3.

Is it possible to make an autoplaylist...

Reply #3
to check if a cover art exists in the music folder, you need a command to test it, but a such command does not exist in the default titleformat commands. in earlier version of foobar (<0.9.5.3) it was maybe possible using cwb_hook component that bring the command $fileexists(path) in the query of the autoplaylist ... to test, but cwb_hook is no more supported by foobar.

Is it possible to make an autoplaylist...

Reply #4
I started a similar topic a few days ago.
http://www.hydrogenaudio.org/forums/index....c=68574&hl=

I called the vbs script with foo_run (had no luck with the bat.file, but i don't know how to give foo_run the correct command...).
Maybe someone can rewrite it not to output a TXT-file with the folders that misses a specified file but create at least a normal playlist (if its possible...)
Or it should be possible with foo_run and the foobar command for 'new playlist', shouldn't it?.

I tried it but had no luck...
But i don't have experience with foo_run and its possibilities, i only tried it once 

Is it possible to make an autoplaylist...

Reply #5
Using AlbumArtAggregator, you can see which albums has/hasn't got album art and even download some from Amazon.

 

Is it possible to make an autoplaylist...

Reply #6
It'll be either in the same folder as the track or potentially embedded in the file if it's an MP3.
if the albumart is embedded, you can use mp3tag, as foobar can't tell us about it right now

I called the vbs script with foo_run (had no luck with the bat.file, but i don't know how to give foo_run the correct command...).
Maybe someone can rewrite it not to output a TXT-file with the folders that misses a specified file but create at least a normal playlist (if its possible...)
Or it should be possible with foo_run and the foobar command for 'new playlist', shouldn't it?.
hi, tedgo

the .bat file must be executed in your media library folder, because there is no way to tell where the media library is (or maybe with foo_exvar?)
but at the end it's no so sophisticated as vbscript
your idea is nice, i haven't thought about it, so i checked again your script and made few changes:

it lists folders regardless if there is media in it or not (for ex. empty artist folder)
 - changed to exclude empty folders

no arguments
 - changed to accept up to two arguments

handling
 - i could take foobar registry value but then what about portable installs or different OSs - i don't know
 - using \program files\foobar2000 folder also is rejected
 - and at the and i decided to output result as a .m3u so that default application can handle it (that means that M3U must be associated with foobar or some other application will be launched)

here is the code:
Code: [Select]
Option Explicit
Dim fso, oApp, oSource, strPath, strFilename
Dim tmpFile, oShell, oFile

Set fso = CreateObject("Scripting.FileSystemObject")
Set oShell = CreateObject("WScript.Shell")
Set oApp = CreateObject("Shell.Application")

 
If Wscript.Arguments.Count = 0 Then
Set oSource = oApp.BrowseForFolder(0, "Select folder to add", 22, 12)
strPath = oSource.Items().Item().Path
Else
strPath = Wscript.Arguments(0)
If Wscript.Arguments.Count = 2 Then
strFilename = Wscript.Arguments(1)
End If
End If

If strFilename = "" Then
strFilename = InputBox("Please type in filename incl. extension, e.g. 'folder.jpg'","Browse folder","")
End If

If strPath <> "" And strFilename <> "" Then
Set oFile = fso.CreateTextFile("Result.m3u", True)
GetFolder strPath, strFilename
oFile.Close

oShell.Exec("%programfiles%\foobar2000\foobar2000 /command:" & chr(34) & "New Playlist" & chr(34) & " Result.m3u")

End If

Sub GetFolder(strFolder,strFilename)
Dim oFolder, oFolders, oFiles, item, strFile

Set oFolder = fso.GetFolder(strFolder)
Set oFolders = oFolder.SubFolders

For each item in oFolders
GetFolder item, strFilename
Set oFiles = item.Files

strFile = item.Path + "\" + strFilename

If Not (fso.FileExists(strFile)) And (oFiles.Count > 0) Then
oFile.WriteLine item.Path
End If
Next

End Sub
put it into run services:


if no command line arguments are given it will ask you to browse and then to choose the file name
if only one argument is given then it'll be treated as path from where to search for missing file and you'll be asked about file name

edit: clean up

Is it possible to make an autoplaylist...

Reply #7
Thanks.
I'll give it a try.
Does it accept wildcards?
Would be great for searching *.lrc-files.

EDIT:
Thanks again.
Works great
Now the only thing is to create a new playlist instead of overwriting the current one.
Shouldn't it be possible to integrate the foobar2000 commandline for 'create new playlist' somehow?

Is it possible to make an autoplaylist...

Reply #8
Hm. Pity foobar can't do this natively, but thanks for the script.

Is it possible to make an autoplaylist...

Reply #9
Now the only thing is to create a new playlist instead of overwriting the current one.

replace line 28:
Code: [Select]
oShell.Run "Result.m3u"

with this one:
Code: [Select]
oShell.Exec("%programfiles%\foobar2000\foobar2000 /command:" & chr(34) & "New Playlist" & chr(34) & " Result.m3u")


i'll try something about wildcards later, and post if i come to something

i'm glad you find it useful

Is it possible to make an autoplaylist...

Reply #10
Oh its very useful
Wildcard thing is important though.

Oh, one moment...
It only searches for folders that doesn't contain the specified file, not able to search for files are associated with the specified file, doesn't it?
A search for associated files would also be a good idea.
With wildcards it would be possible to search for folders that doesn't contain *lrc-files at all, but a search for associated files would be able to find files in a folder that contains one or two *lrc's, but not for all tracks.
Do you know what i mean?

Ah... I think we should better post about the script in the other topic.
Don't hijacking this that's only about album art... 

Btw.
Tested it and your new modification is fabulous 

 
SimplePortal 1.0.0 RC1 © 2008-2021