Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Playlist fields with null values #52

Closed
stvnjohnson opened this issue Apr 4, 2016 · 13 comments
Closed

Playlist fields with null values #52

stvnjohnson opened this issue Apr 4, 2016 · 13 comments

Comments

@stvnjohnson
Copy link

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.

@simon-weber
Copy link
Owner

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?

@onespaceman
Copy link

A quick hack is to create a playlist with

[field] does not contain (case ignored) a
[field] does not contain (case ignored) e
[field] does not contain (case ignored) i
[field] does not contain (case ignored) o
[field] does not contain (case ignored) u

@simon-weber
Copy link
Owner

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.

@stvnjohnson
Copy link
Author

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.

image

@simon-weber
Copy link
Owner

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.

@stvnjohnson
Copy link
Author

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.

@simon-weber
Copy link
Owner

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:

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?

I can't think of a time when we'd want to query one but not the other, but maybe you can?

@stvnjohnson
Copy link
Author

Quick note - i still do have albums that have songs which return with no genre field when testing, so I still believe the capability to query on empty strings as you suggested above would be valuable.

image

@stvnjohnson
Copy link
Author

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.

@simon-weber
Copy link
Owner

Great; this ought to be an easy improvement. I'll get to it in the next release.

@stvnjohnson
Copy link
Author

Baller. I'll definitely be subscribing as soon as that's implemented. You've got a great solution here.

@simon-weber
Copy link
Owner

😊 thanks!

@simon-weber simon-weber self-assigned this Apr 5, 2016
@simon-weber
Copy link
Owner

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).

@simon-weber simon-weber removed their assignment Apr 6, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants