Playlist with two Smart Playlists

Issue description:

I’ve tried to use the * in smart playlist* to include two smart playlists and I cannot get the results to be what I expect

Logs:

Upload description: telrod11

Additional information:

 
If I create the new playlist test using the parameters that I built the two smart lists on it works as it should.

It just does not give me the results if I use the in smart playlist category
 

Reproduction steps:

 
Create a new smart playlist called test

Include two of my existing smart playlist to be this playlist

When using the any or all parameters, it does not give me the number of songs that it should from these two playlists combined

 

Media provider:

Local device

Screenshots:

     




You don’t really give enough details here. Like what do you actually expect ?
What is the playlist Play count 0 definition?
Why do you need to have a playlist that include that playlist and another playlist that include that playlist that include that playlist too?
What is the content of Play count 0 playlist.

The first smart playlist is: OVER 165 days AND Play count=1.

The second smart playlist is Playcount=0

I can certainly use these parameters (and I am) successfully in a new playlist, and that’s fine, no problem.

I was only reporting that when I use the parameters for this new playlist as “IN SMART PLAYLIST” and select the two existing Smart playlists, I cannot get the results that I would expect.

When I use ANY, I get 2300+ results. When I use ALL, I get zero results. (It should give 113 or so songs, and it does when I recreate the playlist.)

Sorry if this is confusing.

That’s not what you show in your screens shots at all.

But of course all will give 0 result. You can’t have songs that have Play count 1 and Play count 0 at the same time.

Or what you describe is not what you actually do.

If you use any then it will give you the content of both playlists.

So you might want to explain what you are trying to do better because I think you misunderstand how it works.

Ok, let me play with the logic I’ve used on those two combined playlists for a bit.

I just created two new simple ones and they worked as they should, so it must be a logic issue on my end.

Sorry for the bother

Ok, sorry again…

With the simple one rule playlists combined it seems to work fine, but when there are two+ rules in the playlists I’m combining it seems to fail.

(Again, I’m probably totally wrong, but maybe you can help me with my lack of logic)

Look at these screenshots and the results, and help me see where I’ve messed up?






I’m doing thai from the phone, so I may have some of this messed up on the screenshots I’ve provided

You show play count 8 and use play count 0.

Please take the necessary time to do things properly and report if there’s an actual issue.

Apologies…

Let’s see if this shows what I’m getting…

Test Smart playlists combining the “Not played in 175 days” and “PlayCount 8”

There should be 148 songs with that combined.

It shows 2437 in that new “test” playlist.

See if these screenshots help this time.






So now you can upload logs for that one :slight_smile:

Ha, probably still something I have wrong.

Logs uploaded telrod11_the_pain_for_tolriq

I have that original test playlist in this log, but created a test 1 with the same criteria as above.

Playlist not played in 175 days - 8 tracks
Playlist Playcount 8 - 140 tracks

New Test 1 playlist - 2437 tracks

Thanks

You do not enter the other individual playlists to see how they act.

From the logs the query is correct (except that strangely your screenshot shows order by random but the logs shows order by song duration).

I have recreated the exact same playlists and everything works as expected here.


__


Is it possible that I might have a corrupted DB?

If I put multiple playlists together, that have one parameter, such as play count, they seem to work as they should.
But…if I combine any of the ones I’ve created that use the criteria play count and last played, they exhibit this.

Here’s another one I just did: Play Count 1 / Last Played 125 days + another with Play Count 0






I see you have the same as me, and it doesn’t fail on your end, would it make sense to uninstall, and restore and test again?

No, you can press cleanup internal state in advanced settings to have sqlite run an couple of cleanup stuff.

But this sounds like an SQLite issue on your device as the queries are correct in the logs and it behave correctly on all my devices.

Edit; Actually you use the same device as me but with Android 16 beta, will see if there’s something special broken in Android 16. (Just tested and it works properly there too)

Yeah, 16 Beta #4.

I’ll cleanup my sql and see if I rebuild another what it does.

Oh man, here we go…

Tried to just one step through this, and just add one smart list and test…

Look what this one does…




Once again provide logs going into both of those playlists to see what is happening in both.

Log uploaded telrod11-1730

I created two new playlists zzTest, and zzTest2 last played 175.

Zztest is just using smart playlist last played 125 days play count 1 and has a total of. 1502 songs.

Zztest 2 based on smart playlist last played 175 days play count 1 should have 10 songs.

Both zzTest playlists come up with the same number of songs, even though they are totally based on different smart playlists, and have identical 2316 songs.

Do you want me to uninstall now, rebuild from scratch, as a test, then restore and see what I get?

You can try but it should not do more than the cleanup internal states.

There’s 15 millions playlist access in those logs…

But I can see that you have 12 playlists with the same unique id …

SELECT playlists._id, playlists.provider_id, playlists.type, playlists.content_type, playlists.media_type, playlists.external_id, playlists.external_data, playlists.title, playlists.thumbnail, playlists.offline_status, playlists.auto_offline, playlists.auto_sync, playlists.smart_filter, playlists.is_favorite, playlists.resume_file, playlists.random_seed, playlists.duration, playlists.song_count, playlists.last_modified, playlists.local_thumbnail, playlists.tags, playlists.last_played, playlists.sort_order, playlists.date_added, playlists.display_mode, playlists.fav_date, playlists.unique_id, playlists.display_mode_size, playlists.display_mode_spacing FROM playlists WHERE (playlists._id= ? OR playlists.unique_id= ?) ('65f93b7a-31f6-4884-b6d3-a29637946b56','65f93b7a-31f6-4884-b6d3-a29637946b56') [12 in 0.76ms]

And the first one with that id returns those 2316 results

Query: SELECT songs._id, songs.thumbnail, songs.title, songs.display_artist, songs.duration, songs.offline_status, songs.external_id, songs.provider_id, CASE WHEN songs.thumbnail IS NULL THEN albums.thumbnail ELSE songs.thumbnail END, CASE WHEN (songs.local_thumbnail IS NULL AND songs.thumbnail IS NULL) THEN albums.local_thumbnail ELSE songs.local_thumbnail END, albums.title, songs.file, songs.external_data, songs.is_favorite, songs.play_count, songs.rating, songs.user_rating FROM songs LEFT JOIN albums ON (songs.album_id=albums._id) WHERE ((songs._id IN (SELECT songs._id FROM songs WHERE ((songs.last_played < ?) AND (songs.play_count = 1)) AND (songs.provider_id IN (1)) ORDER BY songs.duration ASC LIMIT 111111))) ORDER BY RANDOM() ASC LIMIT 11111 ('2025-01-10 16:28:52') [2316 in 32.27ms]

So everything works correctly, now the actual question is how the hell do you manage to have playlists with the same unique ID.

OK, I have 37 Playlists, I don’t do any importing of playlists, these are all built from scratch inside SF, and most have been here since early versions.

I just manually went through all the 37 I can see, and not one produces the 2316 number song count. I’m curious where the query is pulling from then..

Thoughts?

UUID basically can’t have collision, let alone 12 times …

I have no way to know what you did to reach that state and can’t know what playlist may be hidden by filters, all I know is what the logs shows.

So with the history :slight_smile: I suggest you start fresh and recreate your playlists to avoid such issue.