Kodi Community Forum

Full Version: MyMusic60.db strange track numbers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
In looking at my database the song table has some strange entries for iTrack on some albums. it appears that a hex entry is using a flag bit in an upper byte. So track 1 is stored as 65537 (0x00 0x01 then 2 byte for track number). I don't think it is signed vs unsigned, right?

These track numbers display OK in music and musicplaylist windows, but don't display in container(50) in musicinformation dialog AFAICT. (Probably need to do some more testing, but didn't want to forget about this.)

scott s.
Scott, song.iTrack values are a combination of disc and track number, has been that way for many versions not just Krypton. Makes track sorting across multi-disc albums easy.

int CMusicInfoTag::GetTrackNumber() const
  return (m_iTrack & 0xffff);

int CMusicInfoTag::GetDiscNumber() const
  return (m_iTrack >> 16);
Of course no disk number in tags is taken as disc=0, and song.iTrack will look like the track number.

This encoding into a single field is not correctly handled by smart playlist rules (I have it on my list to fix), but I am unaware of any info dialog issue. The tracknumber listitem uses GetTrackNumber.

If you find an issue then let me know.