|
Kodi Documentation 22.0
Kodi is an open source media player and entertainment hub.
|
#include "FileItem.h"#include "FileItemList.h"#include "URL.h"#include "filesystem/AudioBookFileDirectory.h"#include "music/Artist.h"#include "music/tags/MusicInfoTag.h"#include "music/tags/TagLibVersion.h"#include "test/TestUtils.h"#include <string>#include <gtest/gtest.h>Functions | |
| TEST (TestAudioBookFileDirectory, MakesOneTrackPerTaggedChapter) | |
| TEST (TestAudioBookFileDirectory, ReadsTagsOfAChapterNumberedFromOne) | |
| TEST (TestAudioBookFileDirectory, NamesTracksAfterTheirChapterDisplayName) | |
| A chapter named only by its ChapterDisplay still names its track, rather than taking the album's. | |
| TEST (TestAudioBookFileDirectory, PrefersAChapterTitleTagToItsDisplayName) | |
| Where a chapter has both, its own TITLE tag is the better source and wins. | |
| TEST (TestAudioBookFileDirectory, DropsAMicroChapterWithoutShiftingTheRest) | |
| TEST (TestAudioBookFileDirectory, KeepsTheTrackNumberAChapterGivesItself) | |
| PART_NUMBER is what the tagger meant the track to be, so it outranks the position in the file. | |
| TEST (TestAudioBookFileDirectory, IgnoresTagsFromAnEditionItDidNotSelect) | |
| TEST (TestAudioBookFileDirectory, RefusesAChapteredFileThatNamesNoAlbum) | |
| TEST (TestAudioBookFileDirectory, KeepsEveryChapterOfAFileThatDeclaresNoEnds) | |
| TEST (TestAudioBookFileDirectory, ExpandsAnAlbumTaggedWithNoLevel) | |
| TEST (TestAudioBookFileDirectory, ReadsTheSecondFileWhenReusedAcrossURLs) | |
| TEST | ( | TestAudioBookFileDirectory | , |
| DropsAMicroChapterWithoutShiftingTheRest | ) |
The fixture holds a 0.4s chapter between the first and second track. Dropping it must not shift the tags of everything after it onto the wrong chapter, which is what indexing one reader's chapter list by another reader's position did.
| TEST | ( | TestAudioBookFileDirectory | , |
| ExpandsAnAlbumTaggedWithNoLevel | ) |
A file whose album tags carry no TargetTypeValue is still an album. The spec asks for one and taggers skip it, which is why such a tag is read as describing the file - and a file that says what album it is, is worth expanding however it said it.
The album's name comes from the TITLE those levelless tags carry, not from the Segment title, which the fixture deliberately names differently: both land among the file's tags, and a tag the file states outright says more about it than the container's own name for itself.
| TEST | ( | TestAudioBookFileDirectory | , |
| IgnoresTagsFromAnEditionItDidNotSelect | ) |
A file can hold several editions and only one of them is followed. Tags targeting a chapter of an edition that was not selected describe tracks this file does not produce, so they must reach neither the tracks nor the album.
| TEST | ( | TestAudioBookFileDirectory | , |
| KeepsEveryChapterOfAFileThatDeclaresNoEnds | ) |
A chapter that declares no end looks zero seconds long where it also starts at zero, which is every first chapter of a file whose ChapterTimeEnds are unset - and such files are common enough that scanning a concert lost its opening song (xbmc/xbmc#28902). Ends are worked out from the next chapter's start before anything decides what is too short to be a track, so the whole running order survives, not just the first one.
| TEST | ( | TestAudioBookFileDirectory | , |
| KeepsTheTrackNumberAChapterGivesItself | ) |
PART_NUMBER is what the tagger meant the track to be, so it outranks the position in the file.
| TEST | ( | TestAudioBookFileDirectory | , |
| MakesOneTrackPerTaggedChapter | ) |
| TEST | ( | TestAudioBookFileDirectory | , |
| NamesTracksAfterTheirChapterDisplayName | ) |
A chapter named only by its ChapterDisplay still names its track, rather than taking the album's.
| TEST | ( | TestAudioBookFileDirectory | , |
| PrefersAChapterTitleTagToItsDisplayName | ) |
Where a chapter has both, its own TITLE tag is the better source and wins.
| TEST | ( | TestAudioBookFileDirectory | , |
| ReadsTagsOfAChapterNumberedFromOne | ) |
A chapter numbered from one keeps its own tags. Every nonzero ChapterUID names a chapter, and a tag whose chapter is not found would be promoted to the album instead - taking the album's title for its own and leaving the track unnamed.
| TEST | ( | TestAudioBookFileDirectory | , |
| ReadsTheSecondFileWhenReusedAcrossURLs | ) |
Nothing stops a caller handing one instance a second URL. The demuxer context the first file was opened through used to outlive that file: only what had been parsed was re-keyed on the URL, so the second file was described by the first one's cover art and codec details - and, where FFmpeg is the reader, by its chapters and tags too. Both are refreshed together now.
| TEST | ( | TestAudioBookFileDirectory | , |
| RefusesAChapteredFileThatNamesNoAlbum | ) |
A file with chapters but no tags is not an album, whichever reader read it. FFmpeg reports the mandatory MuxingApp element as metadata, so a file always arrives carrying something.