Rockbox Technical Forums

Support and General Use => Audio Playback, Database and Playlists => Topic started by: Buzkill on September 01, 2021, 01:58:57 PM

Title: SOLVED Grouping Tag
Post by: Buzkill on September 01, 2021, 01:58:57 PM
Im not able to get the grouping tag to work as expected in tagnavi_custom.

Is it actually a usable tag like it says in on the database write up?

Code: [Select]
%menu_start "custom" "metal group"
"metal" -> artist ? grouping ~ "metal" -> album -> title = "fmt_title"

By using this i actually only get Songs Titles that have "Metal" in them
so it seems to be checking  the "title" tag  and not "grouping"

Title: Re: Grouping Tag
Post by: chris_s on September 01, 2021, 05:14:37 PM
That's because the title is currently used when the grouping tag is empty, see here for an explanation from the person who originally implemented support for the grouping tag: https://www.rockbox.org/tracker/task/7362
Quote
when building the database and a track doesn’t have a grouping tag, it copies the value from the title tag. This should make browsing through classcical works in the database a bit nicer since you will find all your music, not only titles having the grouping tag explicitely set (similar to the recent albumartist improvement). Y
I have to admit,  I don't quite understand that reasoning, even in the context of classical works. I had the same experience as you where it seemed like the tag simply didn't "work" correctly in the database when I viewed groupings/works by composer, since the list was polluted by song titles, which is why I personally changed it in code for the version I'm running. It's very easy to do. Just look for the if statements in apps/tagcache.c that use has_grouping as a conditional and only keep the part that would be executed if has_grouping was true,

so from lines 2019 to 2026, only keep line 2021:
https://github.com/Rockbox/rockbox/blob/a8253c57ddec8a1dfb2f77e7be9c451595fb094a/apps/tagcache.c#L2021
and from lines 2048 to 2055 only keep line 2050:
https://github.com/Rockbox/rockbox/blob/a8253c57ddec8a1dfb2f77e7be9c451595fb094a/apps/tagcache.c#L2050
Title: Re: Grouping Tag
Post by: Buzkill on September 01, 2021, 05:17:12 PM

so from lines 2019 to 2026, only keep line 2021:
https://github.com/Rockbox/rockbox/blob/a8253c57ddec8a1dfb2f77e7be9c451595fb094a/apps/tagcache.c#L2021
and from lines 2048 to 2055 only keep line 2050:
https://github.com/Rockbox/rockbox/blob/a8253c57ddec8a1dfb2f77e7be9c451595fb094a/apps/tagcache.c#L2050


Thanks for the tip! I'll test it out later today.
Title: Re: Grouping Tag
Post by: Buzkill on September 02, 2021, 10:27:34 AM
Quote
so from lines 2019 to 2026, only keep line 2021:
https://github.com/Rockbox/rockbox/blob/a8253c57ddec8a1dfb2f77e7be9c451595fb094a/apps/tagcache.c#L2021
and from lines 2048 to 2055 only keep line 2050:
https://github.com/Rockbox/rockbox/blob/a8253c57ddec8a1dfb2f77e7be9c451595fb094a/apps/tagcache.c#L2050

So i did this and it *kinda* worked.  For my test I removed all grouping tags from all my music on the device, and then proceeded to label a single album with the grouping tag "Metal".
I added:
Code: [Select]
"Heavy" -> artist ? grouping = "Metal" -> album -> title = "fmt_title"...to my custom nav file, but nothing shows up, Just <All Tracks> and <Random> telling me it found nothing. And so i tried this, with no condition, just to see what would show up...
 
Code: [Select]
"Group Test" -> grouping  -> artist -> album -> title = "fmt_title" and strangely all the Music WITHOUT grouping tags shows up and the entire album I added the "Metal" tag to show up in <UNTAGGED> perfectly sorted.

so it's as if the database is adding the track title to the grouping tag database if there is no grouping tag and leaving it untagged if there is a grouping tag.

Not sure what i did wrong or missed, or maybe something's changed,but you were saying you have it working so it must be on my end. Any ideas?



Title: Re: Grouping Tag
Post by: Buzkill on September 02, 2021, 11:01:30 AM
it's as if the code is working like this...

Code: [Select]
if (has_grouping)
    {
        #do nothing
    }
    else
    {
        ADD_TAG(entry, tag_grouping, &id3.title);
    }
Title: SOLVED RE:GROUPING TAG
Post by: Buzkill on September 02, 2021, 11:51:12 AM
SOLVED

So the issue was that i was using the wrong "grouping" tag in mp3tag. I guess rockbox looks at the CONTENTGROUP tag and not the actual GROUPING tag. Swapping to that fixed the issue.

Funny enough though, it seems by putting any information in the GROUPING tag with mp3tag, seems to make rockbox ignore it, even though it looks at CONTENTGROUP.

is this somthing i should report as a "bug"?
Title: Re: SOLVED Grouping Tag
Post by: Chronon on September 25, 2021, 02:45:00 PM
I would say so.