Playlist fields with null values #52
Comments
Ah. I don't think there's any way to query on anything but strings and floats right now: the input is passed verbatim using the type defined here. I agree that querying on other values (particularly null) seems useful 👍. What do you think about coercing null to the empty string? Is there any time we'd want to query for null, but not include empty strings in the results? |
A quick hack is to create a playlist with [field] does not contain (case ignored) a |
Oh, yeah, using negation is clever as a workaround. An even shorter approach for text fields would be something like ("does not contain ." AND "does not equal [leave the field empty]"), which excludes anything containing a character, as well as the empty string. |
Just tried onespaceman's hack (adding field does not contain "&" to catch R&B), but the test returns no results. After digging around, it turns out that when genre field in library edit is empty, many (maybe most) times it is because there are multiple genres associated (see attachment). So perhaps genre isn't without a value here, even if the field is blank? However, I'm unable to look for genre field contains "," - so i'm not sure how I could go about catching those occurrences. |
Oh, weird. Can you try testing a playlist that just matches one of these songs (maybe querying on title)? That should show you exactly what value the genre has. |
Querying on the title "Celebration" (first track on the album from the screenshot above) returns with the Genre as "Disco". So it appears that Genre is scoped at the Song level, rather than the Album level. If the Album all has a single Genre, then the Genre field in Edit album info will not be empty But if the album has songs with different Genres, that Album Genre field will be empty (perhaps because the field type doesn't support an array or something along those lines). tl;dr is, there doesn't appear to be an "album genre" field you can query, genre is set at the song level. |
Ah, gotcha; yeah, as far as I know your library is just a list of songs, and everything their client does builds on that. That genre rollup is pretty bizarre ux, though. Going back to this:
I can't think of a time when we'd want to query one but not the other, but maybe you can? |
I also cannot think of a time when i'd want to query null but not empty strings. I'm sure there's a corner case or two i'm not considering, but I nothing comes to mind. |
Great; this ought to be an easy improvement. I'll get to it in the next release. |
Baller. I'll definitely be subscribing as soon as that's implemented. You've got a great solution here. |
😊 thanks! |
Thanks for bringing this up! I just cut a release; it should be available shortly. If you're eager to update, you can hit the "Update extensions now" on chrome://extensions (it requires developer mode to be enabled). |
I've noticed that many times albums in my library are missing metadata fields like genre or year, they'll just be empty. I wanted to create some automated playlists as a quick way to find those culprits, but it doesn't seem to work. I've tried the following:
genre equals null
genre equals (not set)
genre equals undefined
genre equals blank field
these return zero results when testing.
Oddly, if I go in to my library and purposefully remove the genre from an album, and then do genre equals blank field, then the test returns that album. But it doesn't work for albums where the genre was undefined to begin with.
The text was updated successfully, but these errors were encountered: