ChildCount on albums, seasons and playlists is the played count upstream, not the child count #90
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Found while closing the
EnableUserDatahalf of #86, and outside it.With user data on, upstream reports
ChildCount: 0andRecursiveItemCount: 0for anchor albums that really hold 10 and 15 tracks. We report the real 10 and 15.DtoServicesetsdto.ChildCount = dto.RecursiveItemCountforMusicAlbum,SeasonandPlaylistbefore falling back toLinkedChildren.Lengthand thenGetChildCount— so for those three typesChildCounttakes the played/total count in preference to the real child count, and that count is 0 on a library whose media is not on the host. Ours is always the direct-child count.There are two things in it:
child_countonFields=ChildCount. Upstream emits it for those three types whenever user data is on andRecursiveItemCountwas asked for, whether or notFieldsnamed it.Nothing in
portable.jsonasks for it, so no scenario sees either half.Closed for albums and seasons, and deliberately not done for playlists.
An album and a season now report what sits below them as their child count, whether or not
FieldsnamedChildCount, falling back to their direct children where the user's state was not filled in — which is upstream's three-step chain minus the step it cannot reach.Measured on a season holding 13 children of which 4 are neither folders nor unaired:
Fields=ChildCount13, no recursive countFields=RecursiveItemCount4/4Fields=ChildCount,RecursiveItemCount4/4EnableUserData=false13, no recursive countA playlist is left out, and the issue's own framing needs correcting on two points.
First, the reason the anchor's albums report
0: not that the media is off the host, as this issue says, but that itsAncestorIdstable holds no rows naming aMusicAlbumat all — 0 descendants against 10 direct children. Every album on that library reports 0 whatever either server does, which is precisely why the album numbers cannot tell a correct implementation from one that hardcodes 0. The season above can, and does.Second, a playlist's contents are
LinkedChildren, not descendants — and that feeds all three steps of upstream's chain, not just the middle one. Nothing in this port reads that table, so what sits below a playlist is always nothing. Including playlists would answer0where the count is simply unknown, which is worse than answering the direct children; socounts_below_as_childrennames an album and a season only, and says why.Two adjacent things noticed and left alone, neither this issue's: an audio playlist reports a played state from its children where
Playlist.SupportsPlayedStatus => MediaType == Videosays it should not, andBoxSethas the sameLinkedChildrenblind spot for its recursive count.