HydrogenAudio

Hosted Forums => foobar2000 => General - (fb2k) => Topic started by: trebordean on 2009-08-14 12:36:37

Title: Unplayed Albums
Post by: trebordean on 2009-08-14 12:36:37
Is there a method to display any album that has none of it's tracks played?
Title: Unplayed Albums
Post by: Mar2zz on 2009-08-14 18:37:26
It's only possible to show tracks that has not been played yet. unfortunately, you can't query the database albumwide or artistwide.

maybe, if you use columns ui you could use foo_playlist_tree_mod. I didn't use this component, but it's predecessor, foo_playlist_tree could query albumwide/artistwide/genrewide and so on. Actually, it didn't query the database for that, but it's own nested results (query in query).
Title: Unplayed Albums
Post by: shakey_snake on 2009-08-14 18:42:37
Add the "Played" statistics column to an album pane in foo_facets (http://foobar2000.audiohq.de/foo_facets/)
Title: Re: Unplayed Albums
Post by: mjm716 on 2021-09-26 08:24:00
Is there a method to display any album that has none of it's tracks played?

Reviving an old question...

I can get the albums displayed in a playlist column or facets (re: Shakey above) but is there currently a way to do this which is autoplaylist compatible?

I tried
Library > album list > filter by %last_played_enhanced% MISSING

but results are still track based and not album grouped.
Title: Re: Unplayed Albums
Post by: Lucidae on 2021-09-26 10:20:02
I can get the albums displayed in a playlist column or facets (re: Shakey above) but is there currently a way to do this which is autoplaylist compatible?

I tried
Library > album list > filter by %last_played_enhanced% MISSING

but results are still track based and not album grouped.
"Library Tree" (https://hydrogenaud.io/index.php?topic=111060.0) album list can apply filters and maintain album grouping, it already has a 'never played' preset.
Title: Re: Unplayed Albums
Post by: marc2k3 on 2021-09-26 12:34:05
is there currently a way to do this which is autoplaylist compatible?

Nope. That will always be track based.

I guess facets can't handle %last_played_enhanced% field so trying the Library Tree suggestion above might be your easier route (assuming customising the playcount field is easy and doesn't require editing the script).

foo_uie_sql_tree or the murky world of scripting with Spider Monkey Panel/JScript Panel are the harder ways to do it!
Title: Re: Unplayed Albums
Post by: mjm716 on 2021-09-26 13:46:57
Thanks to you both...

"Library Tree" (https://hydrogenaud.io/index.php?topic=111060.0) album list can apply filters and maintain album grouping, it already has a 'never played' preset.

I tried this and it is still track based - results are all albums with the played tracks removed.

I'm trying to remove an album from results if it had any played tracks.
Title: Re: Unplayed Albums
Post by: marc2k3 on 2021-09-26 14:55:04
Here's a script for JScript Panel that generates a static playlist containing albums with no plays. Customise the fields at the beginning to suit. It might work with SMP but not tested. just remembered it won't work with SMP

It's a plain white panel and you double click to execute the code. Obviously it's just an example of what is possible, not meant for full time usage.

Code: [Select]
var group_by = "%album artist%|%album%|%date%";
var filter_by = "album PRESENT";
var playcount = "$if2(%last_played_enhanced%,0)"; // must evaluate to zero for unplayed tracks

///////////////////////////////////

var tfo = {
group_by : fb.TitleFormat(group_by),
order_by : fb.TitleFormat(group_by + "|%discnumber%|%tracknumber%"),
playcount : fb.TitleFormat(playcount),
}

function on_mouse_lbtn_dblclk() {
var items = fb.GetQueryItems(fb.GetLibraryItems(), filter_by);
items.OrderByFormat(tfo.order_by, 1);
var album_list = fb.CreateHandleList();
var to_add = fb.CreateHandleList();
var current = "";
var good = true;

for (var i = 0; i < items.Count; i++) {
var item = items.Item(i);

var tmp = tfo.group_by.EvalWithMetadb(item);
if (tmp != current) {
if (good && album_list.Count) {
to_add.AddRange(album_list);
}

album_list.RemoveAll();
good = tfo.playcount.EvalWithMetadb(item) == 0;
if (good) album_list.Add(item);
current = tmp;
} else {
if (tfo.playcount.EvalWithMetadb(item) == 0) {
if (good) album_list.Add(item);
} else {
if (album_list.Count) album_list.RemoveAll();
good = false;
}
}
}
if (to_add.Count) {
var p = plman.CreatePlaylist(plman.PlaylistCount, "Albums with no plays");
plman.ActivePlaylist = p;
plman.InsertPlaylistItems(p, 0, to_add);
}
}
Title: Re: Unplayed Albums
Post by: mjm716 on 2021-09-26 15:18:23
Here's a script for JScript Panel that generates a static playlist containing albums with no plays.

Very nice - works well. Is there a mod to generate autoplaylist? ;)
Title: Re: Unplayed Albums
Post by: marc2k3 on 2021-09-26 15:57:46
Nope. No amount of scripting trickery can do that. What it is doing is looping over every track in the library and evaluating on a per track basis and keeping track of what the current state is for every track belonging to the same album - something not possible with standard title formatting.

I suppose it is possible to create a fake autoplaylist in the sense it clears and updates itself whenever playcounts change but playing from the playlist would be probematic because the focused/playing track would be lost each time.