New bootstrap music scanner (#571)

* Use new Plex Music metadata scanner in tests

* Update tests to match Plex Music scanner metadata

* More tweaks to audio metadata matching

* Another tweak
This commit is contained in:
jjlawren 2020-09-16 17:58:36 -05:00 committed by GitHub
parent fb82bc402b
commit 24901302d7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 10 deletions

View file

@ -7,8 +7,9 @@ from . import conftest as utils
def test_audio_Artist_attr(artist):
artist.reload()
assert utils.is_datetime(artist.addedAt)
assert artist.countries == []
assert "Electronic" in [i.tag for i in artist.genres]
if artist.countries:
assert "United States" in [i.tag for i in artist.countries]
#assert "Electronic" in [i.tag for i in artist.genres]
assert utils.is_string(artist.guid, gte=5)
assert artist.index == "1"
assert utils.is_metadata(artist._initpath)
@ -20,6 +21,7 @@ def test_audio_Artist_attr(artist):
assert artist.ratingKey >= 1
assert artist._server._baseurl == utils.SERVER_BASEURL
assert isinstance(artist.similar, list)
if artist.summary:
assert "Alias" in artist.summary
assert artist.title == "Broke For Free"
assert artist.titleSort == "Broke For Free"
@ -75,7 +77,7 @@ def test_audio_Album_attrs(album):
assert album.parentTitle == "Broke For Free"
assert album.ratingKey >= 1
assert album._server._baseurl == utils.SERVER_BASEURL
assert album.studio is None
assert album.studio == "[no label]"
assert album.summary == ""
if album.thumb:
assert utils.is_metadata(album.thumb, contains="/thumb/")
@ -120,6 +122,7 @@ def test_audio_Album_tracks(album):
assert utils.is_int(track.ratingKey)
assert track._server._baseurl == utils.SERVER_BASEURL
assert track.summary == ""
if track.thumb:
assert utils.is_metadata(track.thumb, contains="/thumb/")
assert track.title == "As Colourful as Ever"
assert track.titleSort == "As Colourful as Ever"
@ -156,6 +159,7 @@ def test_audio_Album_track(album, track=None):
assert utils.is_int(track.ratingKey)
assert track._server._baseurl == utils.SERVER_BASEURL
assert track.summary == ""
if track.thumb:
assert utils.is_metadata(track.thumb, contains="/thumb/")
assert track.title == "As Colourful as Ever"
assert track.titleSort == "As Colourful as Ever"
@ -215,7 +219,7 @@ def test_audio_Track_attrs(album):
if track.grandparentThumb:
assert utils.is_metadata(track.grandparentThumb, contains="/thumb/")
assert track.grandparentTitle == "Broke For Free"
assert track.guid.startswith("local://")
assert track.guid.startswith("mbid://") or track.guid.startswith("plex://track/")
assert int(track.index) == 1
assert utils.is_metadata(track._initpath)
assert utils.is_metadata(track.key)
@ -240,6 +244,7 @@ def test_audio_Track_attrs(album):
assert track._server._baseurl == utils.SERVER_BASEURL
assert track.sessionKey is None
assert track.summary == ""
if track.thumb:
assert utils.is_metadata(track.thumb, contains="/thumb/")
assert track.title == "As Colourful as Ever"
assert track.titleSort == "As Colourful as Ever"

View file

@ -541,8 +541,8 @@ if __name__ == "__main__":
name="Music",
type="artist",
location="/data/Music" if opts.no_docker is False else music_path,
agent="com.plexapp.agents.lastfm",
scanner="Plex Music Scanner",
agent="tv.plex.agents.music",
scanner="Plex Music",
expected_media_count=song_c,
)
)