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: foo_playlist_tree (Read 735917 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

foo_playlist_tree

Reply #1700
One annoying "feature" in this otherwise very good plugin occurs when I want to find a listing by typing its name.  For example, to find Sonic Youth, I might type "son" and I get to the right area of my playlist.  However, if I am looking for The White Stripes, I start typing "The W", but the process stops when I hit the space, and I can only get to the beginning of the "The"s.  (Does that make sense??)

Is there a workaround for this, so I can keep typing a name that contains a space?

Thanks!!

foo_playlist_tree

Reply #1701
One annoying "feature" in this otherwise very good plugin occurs when I want to find a listing by typing its name.  For example, to find Sonic Youth, I might type "son" and I get to the right area of my playlist.  However, if I am looking for The White Stripes, I start typing "The W", but the process stops when I hit the space, and I can only get to the beginning of the "The"s.  (Does that make sense??)

Is there a workaround for this, so I can keep typing a name that contains a space?

Thanks!!

I encountered this problem, but it disappeared as soon as it had emerged. *shrug*

foo_playlist_tree

Reply #1702
I want to get the last played track in a scheme Playlist tree so I can write it to a playlist.

No problem getting back all the tracks sorted by %last_played% date.

I can see how to reverse the order by turning the date into a number and subtracting from 999999999 but how do I restrict the selection to just the latest track?

(I'd also like to do the same in ordinary playlist tree; the maximum track option there will restrict the no. of tracks returned but I can't make it the one I want (latest %last_played%!)

Any ideas??

foo_playlist_tree

Reply #1703
Another query:


How do I get the name of the currently playing playlist in Scheme?

foo_playlist_tree

Reply #1704
Hey guys,

i didnt realy had the time to get into this @scheme thing but it seems to be fancy...
maybe you can tell me, if something can be done with it, maybe you even got some code suggestions.

many people like me want to edit their playback queue... you add something like 10 songs to queue and than you recognize that you want to have the song on 8th position on the 3rd...
here is what i do:

I manage my music and playlists with playlist_tree component.
In playlist_tree you can define source as "@queue"
So i created a new playlist_tree query with source set to @queue and a query which is always true:
criteria: "NOT 1 IS 2"
when i now click the "Queue"-query in my playlist tree, it sends the tracks of queue to the defined playlist, than activates the playlist. In my case the name of the playlist_tree auto-send playlist is always the name of the query. Therefore, after doing so, i am editing a playlist named "queue" which contains exactly the queue.
now i reorder the tracks the way i want them, push my "flush queue"-button, do a ctrl+a to select the whole playlist and than "add to playback queue".

now my question... 
can this flushing and resending to queue be automated with scheme everytime the "Queue" playlist created by the Queue query is changed?
this would give some kind of queue editor, which i think, many people are missing since foobar is around...

Cheers 

foo_playlist_tree

Reply #1705
now my question... 
can this flushing and resending to queue be automated with scheme everytime the "Queue" playlist created by the Queue query is changed?
this would give some kind of queue editor, which i think, many people are missing since foobar is around...


Yes, playlist tree scheme queries can run any main menu or context menu function, so to clear the queue, you would use the function (mainmenu-command "Flush playback queue").  You can add tracks to the queue using the scheme function (contextmenu "Add to Playback Queue" list) where list is a list of handles from functions like for-each-db-entry or for-each-playlist-entry
There used to be a link to my website here.

foo_playlist_tree

Reply #1706
In case it is any use to anyone, here is my scheme code to make a playlist with all tracks by the now playing artist:

Code: [Select]
(let  (( field              (format-title (now-playing) "%artist%"))
        (playlist-index  (find-or-create-playlist "Browser" )))
      (clear-playlist playlist-index)
      (if  (> (string-length field) 1)
            (for-each-db-entry
                  (lambda (handle)
                                (add-to-playlist handle  playlist-index))
            (string-append "artist HAS " field " OR album artist HAS " field ))
))


foo_playlist_tree

Reply #1707
I think this has been up before, but here it is again: Using %<artist>% crashes foobar. Here's the script I'm trying to use, the %<artist>% thing is almost first on line 2:

Code: [Select]
$if(%artist%,
@icon<29>%<artist>%|['['$substr(%date%,1,4)']'] $if2(@icon<11>%album%,@icon<87>-<Unknown album>-)|[$num(%tracknumber%,2) - ]%title%,
@icon<87>-<Unknown artist>-|$if(%album%,@icon<11>%album%|[$num(%tracknumber%,2) - ]%title%,@icon<87>-<Unknown album>-|%title%)
)
I'm currently using %artist% there instead; as mentioned, foobar crashes when I try to use %<artist>%.

 

foo_playlist_tree

Reply #1709
Hi everybody!  First of all thanks for this wonderful plugin...  is one of the many things that makes me use Foobar, and try to use my iPod and everything with it (jejeje is more work, but foobar and this plugin worth it!    )

I have a question:  I have a lot of compilation albums (soundtracks, compilations, two or three artists albums, etc)  That I want to sort as regular albums.  I don't like to have a different "category" for compilations.

I'm formating my node in the next way:

$if($not($meta(album artist)),
%artist%|%date% %album%|[$num(%tracknumber%,2) - ]%title%,
%artist% - %album%|[$num(%tracknumber%,2) - ]%title%)

That is, if the album artist field is empty, use artist, but if it is not, use artist-album tag for the nodes.

Now, what I want to  know is if is possible that, when I select a compilation artist (show as "artist - album" in the node) the next node shows all the album songs, not only the ones that match the artist, but all that macht the album.  I have been trying with $parent, but returns "unidentify function" and in the end,  I always get a one song node, that is what I don't want. 

I have been using the album name in the node, without artist, but this "hides" many artists from my list (for example:  I only have one song by Bob Dylan in my Natural Born Killers soundtrack.  If i use the album name, is hard to know that I have, at least, one Bob Dylan´s song...) My idea is that, if I select the Bob Dylan artist node, the next node shows all the Natural born killers album, and not only the Dylan's song...

I hope i'm clear enogh...  Thanks for your help and regards.

foo_playlist_tree

Reply #1710
hey cwbowron, is it possible to display a different font size in a different panel?

foo_playlist_tree

Reply #1711
I'm having trouble writing what I think should be a simple query.

I have created queries that use playcount and lastplay info to create queries around Played Most, Played Least, Played Long Ago etc.

I wish to exclude files from my catalog (stand up comedy, kids music, etc).

I created a tag called SKIP and added the tag to all files I wish to skip and populated it with a Y.

I did not add the tag to other files (the ones I want to play).

I can write a query (%skip% IS Y) that lists all the files I wish to skip.  I can write a query (%skip% NOT Y) that lists all the files I do NOT wish to skip.

But...  If I add 'and %skip% NOT Y' to any of my other queries, the query fails and sometimes with odd results.  One query that selects files played at least once when the 'and %skip% NOT Y' is appended it selects files that have NOT been played and INCLUDE (not exclusively) files tagged SKIP Y.

Sorry for the long post, perhaps I'm not getting how to include and statements, perhaps my idea of creating a tag is flawed.  I'm looking for some advice.

Mike

foo_playlist_tree

Reply #1712
I'm having trouble writing what I think should be a simple query.

<snip>

But...  If I add 'and %skip% NOT Y' to any of my other queries, the query fails and sometimes with odd results.  One query that selects files played at least once when the 'and %skip% NOT Y' is appended it selects files that have NOT been played and INCLUDE (not exclusively) files tagged SKIP Y.


you need "AND %skip% NOT Y", capital AND.  It's case sensitive.
There used to be a link to my website here.

foo_playlist_tree

Reply #1713
I think this has been up before, but here it is again: Using %<artist>% crashes foobar. Here's the script I'm trying to use, the %<artist>% thing is almost first on line 2:

Code: [Select]
$if(%artist%,
@icon<29>%<artist>%|['['$substr(%date%,1,4)']'] $if2(@icon<11>%album%,@icon<87>-<Unknown album>-)|[$num(%tracknumber%,2) - ]%title%,
@icon<87>-<Unknown artist>-|$if(%album%,@icon<11>%album%|[$num(%tracknumber%,2) - ]%title%,@icon<87>-<Unknown album>-|%title%)
)
I'm currently using %artist% there instead; as mentioned, foobar crashes when I try to use %<artist>%.
Quoting myself here, because I have the answer. It seems all will be OK if you first make a variable with %<artist>%, like here (only the first few functions are relevant in this discussion):

Code: [Select]
$if(%artist%,$puts(ar,%<artist>%)
@icon<29>$get(ar)|['['$substr(%date%,1,4)']'] $if2(@icon<11>%album%,@icon<87>-<Unknown album>-)|[$num(%tracknumber%,2) - ]%title%,
@icon<87>-<Unknown artist>-|$if(%album%,@icon<11>%album%|[$num(%tracknumber%,2) - ]%title%,@icon<87>-<Unknown album>-|%title%)
)
Notice that I have $puts(ar,%<artist>%) on the first line, and $get(ar) on the second line instead of %<artist>% (or just %artist%).

Also, it works this way:
Code: [Select]
$if(%artist%,
@icon<29>$put(ar,%<artist>%)|['['$substr(%date%,1,4)']'] $if2(@icon<11>%album%,@icon<87>-<Unknown album>-)|[$num(%tracknumber%,2) - ]%title%,
@icon<87>-<Unknown artist>-|$if(%album%,@icon<11>%album%|[$num(%tracknumber%,2) - ]%title%,@icon<87>-<Unknown album>-|%title%)
)
Here I define the variable and use it directly ($put instead of $puts).

Now, for the big one: Why does it work these ways, and not the first one, cwbowron?

foo_playlist_tree

Reply #1714

I'm having trouble writing what I think should be a simple query.

<snip>

But...  If I add 'and %skip% NOT Y' to any of my other queries, the query fails and sometimes with odd results.  One query that selects files played at least once when the 'and %skip% NOT Y' is appended it selects files that have NOT been played and INCLUDE (not exclusively) files tagged SKIP Y.


you need "AND %skip% NOT Y", capital AND.  It's case sensitive.


I just tried that and I am still having no luck.  Here is my exact query.

NOT "$substr(%last_played%,1,7)" GREATER 2000-01 AND %skip% NOT Y

My goal in this query is to list songs that I have never played (and are not marked skip).


foo_playlist_tree

Reply #1716


I'm having trouble writing what I think should be a simple query.

<snip>

But...  If I add 'and %skip% NOT Y' to any of my other queries, the query fails and sometimes with odd results.  One query that selects files played at least once when the 'and %skip% NOT Y' is appended it selects files that have NOT been played and INCLUDE (not exclusively) files tagged SKIP Y.


you need "AND %skip% NOT Y", capital AND.  It's case sensitive.


I just tried that and I am still having no luck.  Here is my exact query.

NOT "$substr(%last_played%,1,7)" GREATER 2000-01 AND %skip% NOT Y

My goal in this query is to list songs that I have never played (and are not marked skip).


I got it fixed.  Just a subtle difference.  I had to use NOT %skip% IS Y in all instances and it works. 

foo_playlist_tree

Reply #1717
BUMP


Code: [Select]
;;; Create a tree with 5 gigs of music, rated greater than 3
(let ((total-size 0)
      (max-size (* 1024 1024 5 1000)))
  (for-each-db-entry
   (lambda (handle)
     (let ((size (get-file-size handle)))
       (if (< (+ size total-size) max-size)
       (begin
         (add-node
          handle
          (list
           (format-title
        handle
        "%artist% - %title%")))
         (set! total-size (+ total-size size))))))
   "rating GREATER 3"
   "$rand()"))
There used to be a link to my website here.

foo_playlist_tree

Reply #1718

BUMP


Code: [Select]
;;; Create a tree with 5 gigs of music, rated greater than 3
(let ((total-size 0)
      (max-size (* 1024 1024 5 1000)))
  (for-each-db-entry
   (lambda (handle)
     (let ((size (get-file-size handle)))
       (if (< (+ size total-size) max-size)
       (begin
         (add-node
          handle
          (list
           (format-title
        handle
        "%artist% - %title%")))
         (set! total-size (+ total-size size))))))
   "rating GREATER 3"
   "$rand()"))


Woohoo! It works now. Thanks!

foo_playlist_tree

Reply #1719
I am using Foobar for a short while now, and use playlist tree mainly for adding tracks to queue. I am trying to make an Album Top 25. Maybe my request is too exotic, but i cant get it working.

My best album is in my opinion the album with the highest score on trackplaycount + trackrating + albumrating.
This score i can make visible with the following code in format;

Code: [Select]
@quote<@format<$num($add($sum('%rating%'),$sum('%play_count%'),$avg('%album rating%')),3)>> - %album artist% - %album%|%artist% - %title%


In criteria i use NOT album rating MISSING, but that is not a good criteria. For an album with a high score on trackplaycount and trackrating it should also be possible to get a top25 listing. Sadly, a criteria that checks all folders and tracks makes the refresh query hang for a few seconds. Maybe its possible to make criteria that allready filters albums with a high score?

another problem i have is with sorting and maximize.
The sorting is completely random when i want to reverse it. Only sort by display name works, but that sorts down from low score to high, i want that reversed. For sorting i tried to use several codes, but none works.
Maximize gives me a completely random set of albums. Scores get mixed, it shows not the best 25 albums, but 25 random albums. I tried to maximize by 25 folders. That doesnt work.
Here is a screenshot

Screenie

I hope someone will have an answer to this problem. or maybe another query that almost does the same stuff. thx in advance

foo_playlist_tree

Reply #1720
Hi all,

First, thanks for this powerful component.

I'm new to it, trying to guess a few queries here and there.

What I haven't been able to do so far is to display the total number of files in a node (next to a dynamic folder name).
Something like :

Genre (5559)
+ Classical (123)
+ Jazz (5436)


Thought the tag  %_itemcount% would do it, but it didn't.

Any clue?

Greetings

foo_playlist_tree

Reply #1721
put this in label behind your query name:
Example:
Code: [Select]
Genre (@format<%_itemcount%> tracks>)


And in format:
Code: [Select]
%genre% (@format<'%_foldercount%' albums, '%_itemcount%' tracks>)|%artist% - %album%|
%track% - %title%


becomes:
Genre (5559 tracks)
+ Classical (10 albums, 125 tracks)
+ Jazz (25 albums, 212 tracks)
+ etc.

foo_playlist_tree

Reply #1722
Thx for the reply.  I get better how it works now. With your code I get the itemcount behind the query name.

But for some reason, it won't work with nods. The panel stops creating nods as soon as I add (@format<'%_foldercount%' albums, '%_itemcount%' tracks>) behind %genre%. Instead, it displays the genre of each selected tracks, without any folder (or item/folder count for that matter). Maybe a problem of syntax, I have no idea.

foo_playlist_tree

Reply #1723
You are right, somehow the () in front and at end mess up. When you use <> instead of () it wil work ok (i use <> all the time, i thought changing it to () wouldnt make a difference, so i didn't test it, sorry). the code will be this:

Code: [Select]
%genre% <@format<'%_foldercount%' albums, '%_itemcount%' tracks>>|%artist% - %album%|
%track% - %title%


this gives you:
Genre (5559 tracks)
+ Classical <10 albums, 125 tracks>
+ Jazz <25 albums, 212 tracks>
+ etc.