diff --git a/README.md b/README.md index 81d06d6..9396501 100644 --- a/README.md +++ b/README.md @@ -10,10 +10,10 @@ A rudimentary audio tagger based on Discogs metadata. # Usage ```shell NAME - discogs-tag - Tag the audio files with the given Discogs release. + discogs-tag tag - Tag the audio files with the given Discogs release. SYNOPSIS - discogs-tag RELEASE + discogs-tag tag RELEASE DESCRIPTION Tag the audio files with the given Discogs release. @@ -36,6 +36,46 @@ FLAGS Default: False --skip_position=SKIP_POSITION Default: False + --skip_year=SKIP_YEAR + Default: False + --skip_subtrack=SKIP_SUBTRACK + Default: False + +NOTES + You can also use flags syntax for POSITIONAL ARGUMENTS +``` +```shell +NAME + discogs-tag copy - Copy the audio tags from source to destination folders. + +SYNOPSIS + discogs-tag copy SRC + +DESCRIPTION + Copy the audio tags from source to destination folders. + +POSITIONAL ARGUMENTS + SRC + +FLAGS + --dir=DIR + Default: './' + --dry=DRY + Default: False + -i, --ignore=IGNORE + Default: False + --skip_artist=SKIP_ARTIST + Default: False + --skip_title=SKIP_TITLE + Default: False + --skip_composer=SKIP_COMPOSER + Default: False + --skip_position=SKIP_POSITION + Default: False + --skip_year=SKIP_YEAR + Default: False + --skip_subtrack=SKIP_SUBTRACK + Default: False NOTES You can also use flags syntax for POSITIONAL ARGUMENTS diff --git a/poetry.lock b/poetry.lock index ae3acc8..a383eab 100644 --- a/poetry.lock +++ b/poetry.lock @@ -13,13 +13,13 @@ files = [ [[package]] name = "exceptiongroup" -version = "1.1.3" +version = "1.2.1" description = "Backport of PEP 654 (exception groups)" optional = false python-versions = ">=3.7" files = [ - {file = "exceptiongroup-1.1.3-py3-none-any.whl", hash = "sha256:343280667a4585d195ca1cf9cef84a4e178c4b6cf2274caef9859782b567d5e3"}, - {file = "exceptiongroup-1.1.3.tar.gz", hash = "sha256:097acd85d473d75af5bb98e41b61ff7fe35efe6675e4f9370ec6ec5126d160e9"}, + {file = "exceptiongroup-1.2.1-py3-none-any.whl", hash = "sha256:5258b9ed329c5bbdd31a309f53cbfb0b155341807f6ff7606a1e801a891b29ad"}, + {file = "exceptiongroup-1.2.1.tar.gz", hash = "sha256:a4785e48b045528f5bfe627b6ad554ff32def154f42372786903b7abcfe1aa16"}, ] [package.extras] @@ -41,20 +41,20 @@ termcolor = "*" [[package]] name = "importlib-metadata" -version = "6.8.0" +version = "6.11.0" description = "Read metadata from Python packages" optional = false python-versions = ">=3.8" files = [ - {file = "importlib_metadata-6.8.0-py3-none-any.whl", hash = "sha256:3ebb78df84a805d7698245025b975d9d67053cd94c79245ba4b3eb694abe68bb"}, - {file = "importlib_metadata-6.8.0.tar.gz", hash = "sha256:dbace7892d8c0c4ac1ad096662232f831d4e64f4c4545bd53016a3e9d4654743"}, + {file = "importlib_metadata-6.11.0-py3-none-any.whl", hash = "sha256:f0afba6205ad8f8947c7d338b5342d5db2afbfd82f9cbef7879a9539cc12eb9b"}, + {file = "importlib_metadata-6.11.0.tar.gz", hash = "sha256:1231cf92d825c9e03cfc4da076a16de6422c863558229ea0b22b675657463443"}, ] [package.dependencies] zipp = ">=0.5" [package.extras] -docs = ["furo", "jaraco.packaging (>=9)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] perf = ["ipython"] testing = ["flufl.flake8", "importlib-resources (>=1.3)", "packaging", "pyfakefs", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-mypy (>=0.9.1)", "pytest-perf (>=0.9.2)", "pytest-ruff"] @@ -82,24 +82,24 @@ files = [ [[package]] name = "packaging" -version = "23.2" +version = "24.0" description = "Core utilities for Python packages" optional = false python-versions = ">=3.7" files = [ - {file = "packaging-23.2-py3-none-any.whl", hash = "sha256:8c491190033a9af7e1d931d0b5dacc2ef47509b34dd0de67ed209b5203fc88c7"}, - {file = "packaging-23.2.tar.gz", hash = "sha256:048fb0e9405036518eaaf48a55953c750c11e1a1b68e0dd1a9d62ed0c092cfc5"}, + {file = "packaging-24.0-py3-none-any.whl", hash = "sha256:2ddfb553fdf02fb784c234c7ba6ccc288296ceabec964ad2eae3777778130bc5"}, + {file = "packaging-24.0.tar.gz", hash = "sha256:eb82c5e3e56209074766e6885bb04b8c38a0c015d0a30036ebe7ece34c9989e9"}, ] [[package]] name = "pluggy" -version = "1.3.0" +version = "1.5.0" description = "plugin and hook calling mechanisms for python" optional = false python-versions = ">=3.8" files = [ - {file = "pluggy-1.3.0-py3-none-any.whl", hash = "sha256:d89c696a773f8bd377d18e5ecda92b7a3793cbe66c87060a6fb58c7b6e1061f7"}, - {file = "pluggy-1.3.0.tar.gz", hash = "sha256:cf61ae8f126ac6f7c451172cf30e3e43d3ca77615509771b3a984a0730651e12"}, + {file = "pluggy-1.5.0-py3-none-any.whl", hash = "sha256:44e1ad92c8ca002de6377e165f3e0f1be63266ab4d554740532335b9d75ea669"}, + {file = "pluggy-1.5.0.tar.gz", hash = "sha256:2cffa88e94fdc978c4c574f15f9e59b7f4201d439195c3715ca9e2486f1d0cf1"}, ] [package.extras] @@ -108,13 +108,13 @@ testing = ["pytest", "pytest-benchmark"] [[package]] name = "pytest" -version = "7.4.3" +version = "7.4.4" description = "pytest: simple powerful testing with Python" optional = false python-versions = ">=3.7" files = [ - {file = "pytest-7.4.3-py3-none-any.whl", hash = "sha256:0d009c083ea859a71b76adf7c1d502e4bc170b80a8ef002da5806527b9591fac"}, - {file = "pytest-7.4.3.tar.gz", hash = "sha256:d989d136982de4e3b29dabcc838ad581c64e8ed52c11fbe86ddebd9da0818cd5"}, + {file = "pytest-7.4.4-py3-none-any.whl", hash = "sha256:b090cdf5ed60bf4c45261be03239c2c1c22df034fbffe691abe93cd80cea01d8"}, + {file = "pytest-7.4.4.tar.gz", hash = "sha256:2cf0005922c6ace4a3e2ec8b4080eb0d9753fdc93107415332f50ce9e7994280"}, ] [package.dependencies] @@ -130,17 +130,17 @@ testing = ["argcomplete", "attrs (>=19.2.0)", "hypothesis (>=3.56)", "mock", "no [[package]] name = "pytest-mock" -version = "3.12.0" +version = "3.14.0" description = "Thin-wrapper around the mock package for easier use with pytest" optional = false python-versions = ">=3.8" files = [ - {file = "pytest-mock-3.12.0.tar.gz", hash = "sha256:31a40f038c22cad32287bb43932054451ff5583ff094bca6f675df2f8bc1a6e9"}, - {file = "pytest_mock-3.12.0-py3-none-any.whl", hash = "sha256:0972719a7263072da3a21c7f4773069bcc7486027d7e8e1f81d98a47e701bc4f"}, + {file = "pytest-mock-3.14.0.tar.gz", hash = "sha256:2719255a1efeceadbc056d6bf3df3d1c5015530fb40cf347c0f9afac88410bd0"}, + {file = "pytest_mock-3.14.0-py3-none-any.whl", hash = "sha256:0b72c38033392a5f4621342fe11e9219ac11ec9d375f8e2a0c164539e0d70f6f"}, ] [package.dependencies] -pytest = ">=5.0" +pytest = ">=6.2.5" [package.extras] dev = ["pre-commit", "pytest-asyncio", "tox"] @@ -158,13 +158,13 @@ files = [ [[package]] name = "termcolor" -version = "2.3.0" +version = "2.4.0" description = "ANSI color formatting for output in terminal" optional = false -python-versions = ">=3.7" +python-versions = ">=3.8" files = [ - {file = "termcolor-2.3.0-py3-none-any.whl", hash = "sha256:3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475"}, - {file = "termcolor-2.3.0.tar.gz", hash = "sha256:b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a"}, + {file = "termcolor-2.4.0-py3-none-any.whl", hash = "sha256:9297c0df9c99445c2412e832e882a7884038a25617c60cea2ad69488d4040d63"}, + {file = "termcolor-2.4.0.tar.gz", hash = "sha256:aab9e56047c8ac41ed798fa36d892a37aca6b3e9159f3e0c24bc64a9b3ac7b7a"}, ] [package.extras] @@ -183,18 +183,18 @@ files = [ [[package]] name = "zipp" -version = "3.17.0" +version = "3.18.2" description = "Backport of pathlib-compatible object wrapper for zip files" optional = false python-versions = ">=3.8" files = [ - {file = "zipp-3.17.0-py3-none-any.whl", hash = "sha256:0e923e726174922dce09c53c59ad483ff7bbb8e572e00c7f7c46b88556409f31"}, - {file = "zipp-3.17.0.tar.gz", hash = "sha256:84e64a1c28cf7e91ed2078bb8cc8c259cb19b76942096c8d7b84947690cabaf0"}, + {file = "zipp-3.18.2-py3-none-any.whl", hash = "sha256:dce197b859eb796242b0622af1b8beb0a722d52aa2f57133ead08edd5bf5374e"}, + {file = "zipp-3.18.2.tar.gz", hash = "sha256:6278d9ddbcfb1f1089a88fde84481528b07b0e10474e09dcfe53dad4069fa059"}, ] [package.extras] -docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (<7.2.5)", "sphinx (>=3.5)", "sphinx-lint"] -testing = ["big-O", "jaraco.functools", "jaraco.itertools", "more-itertools", "pytest (>=6)", "pytest-black (>=0.3.7)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy (>=0.9.1)", "pytest-ruff"] +docs = ["furo", "jaraco.packaging (>=9.3)", "jaraco.tidelift (>=1.4)", "rst.linker (>=1.9)", "sphinx (>=3.5)", "sphinx-lint"] +testing = ["big-O", "jaraco.functools", "jaraco.itertools", "jaraco.test", "more-itertools", "pytest (>=6,!=8.1.*)", "pytest-checkdocs (>=2.4)", "pytest-cov", "pytest-enabler (>=2.2)", "pytest-ignore-flaky", "pytest-mypy", "pytest-ruff (>=0.2.1)"] [metadata] lock-version = "2.0" diff --git a/pyproject.toml b/pyproject.toml index 156da9c..c3653f1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "discogs-tag" -version = "0.1.10" +version = "0.2.0" description = "A rudimentary audio tagger based on Discogs metadata." authors = ["infojunkie "] readme = "README.md" diff --git a/src/discogs_tag/cli.py b/src/discogs_tag/cli.py index 08e0eaf..5705149 100644 --- a/src/discogs_tag/cli.py +++ b/src/discogs_tag/cli.py @@ -7,6 +7,7 @@ import glob import sys import re +from functools import reduce from discogs_tag import __NAME__, __VERSION__ def tag( @@ -18,7 +19,8 @@ def tag( skip_title=False, skip_composer=False, skip_position=False, - skip_year=False + skip_year=False, + skip_subtrack=False ): """Tag the audio files with the given Discogs release.""" options = locals() @@ -33,8 +35,70 @@ def tag( ) apply_metadata(data, files, options) +def copy( + src, + dir='./', + dry=False, + ignore=False, + skip_artist=False, + skip_title=False, + skip_composer=False, + skip_position=False, + skip_year=False, + skip_subtrack=False +): + """Copy the audio tags from source to destination folders.""" + options = locals() + src_files = sorted( + glob.glob(os.path.join(glob.escape(src), '**', '*.flac'), recursive=True) + + glob.glob(os.path.join(glob.escape(src), '**', '*.mp3'), recursive=True) + ) + dst_files = sorted( + glob.glob(os.path.join(glob.escape(dir), '**', '*.flac'), recursive=True) + + glob.glob(os.path.join(glob.escape(dir), '**', '*.mp3'), recursive=True) + ) + data = read_metadata(src_files, options) + if options['dry']: + pprint(data) + else: + apply_metadata(data, dst_files, options) + +def read_metadata(files, options): + """Read metadata from OS audio files and return data structure that mimics Discogs release.""" + def safe_position(audio, n): + try: + return audio['tracknumber'][0].split('/')[0].lstrip('0') + except: + return str(n) + + tracklist = [] + for n, file in enumerate(files): + audio = mutagen.File(file, easy=True) + tracklist.append({ + 'type_': 'track', + 'position': safe_position(audio, n+1), + 'artists': [{ + 'anv': audio['artist'][0] + }], + 'title': audio['title'][0], + 'year': audio['date'][0], + }) + return { + 'tracklist': sorted(tracklist, key=lambda track: int(track['position'])) + } + def apply_metadata(release, files, options): - tracks = list(filter(lambda t: t['type_'] == 'track', release['tracklist'])) + """Apply Discogs release metadada to OS audio files.""" + def get_tracks(tracklist): + def reduce_track(tracks, track): + if track['type_'] == 'track': + tracks.append(track) + if not options['skip_subtrack'] and 'sub_tracks' in track: + tracks = tracks + get_tracks(track['sub_tracks']) + return tracks + return reduce(reduce_track, tracklist, []) + + tracks = get_tracks(release['tracklist']) if len(files) != len(tracks): if options['ignore']: print(f'Expecting {len(tracks)} files but found {len(files)}. Ignoring.', file=sys.stderr) @@ -59,6 +123,14 @@ def apply_metadata(release, files, options): print(f'Processed {len(files)} audio files.') def merge_metadata(release, track, audio, options): + def artist_name(artist): + name = None + if 'anv' in artist and artist['anv']: + name = artist['anv'] + elif 'name' in artist and artist['name']: + name = artist['name'] + return re.sub(r"\s+\(\d+\)$", '', name) if name else None + if not options['skip_title']: audio['title'] = track['title'] @@ -86,13 +158,8 @@ def merge_metadata(release, track, audio, options): if 'year' in release and release['year']: audio['date'] = str(release['year']) -def artist_name(artist): - name = None - if 'anv' in artist and artist['anv']: - name = artist['anv'] - elif 'name' in artist and artist['name']: - name = artist['name'] - return re.sub(r"\s+\(\d+\)$", '', name) if name else None - def cli(): - fire.Fire(tag) + fire.Fire({ + 'tag': tag, + 'copy': copy, + }) diff --git a/tests/16215626.json b/tests/16215626.json new file mode 100644 index 0000000..2c542bf --- /dev/null +++ b/tests/16215626.json @@ -0,0 +1,382 @@ +{ + "id": 16215626, + "status": "Accepted", + "year": 1983, + "resource_url": "https://api.discogs.com/releases/16215626", + "uri": "https://www.discogs.com/release/16215626-Pink-Floyd-Wish-You-Were-Here", + "artists": [ + { + "name": "Pink Floyd", + "anv": "", + "join": "", + "role": "", + "tracks": "", + "id": 45467, + "resource_url": "https://api.discogs.com/artists/45467" + } + ], + "artists_sort": "Pink Floyd", + "labels": [ + { + "name": "CBS", + "catno": "CK 33453", + "entity_type": "1", + "entity_type_name": "Label", + "id": 3072, + "resource_url": "https://api.discogs.com/labels/3072" + } + ], + "series": [], + "companies": [ + { + "name": "Pink Floyd Music Ltd.", + "catno": "", + "entity_type": "14", + "entity_type_name": "Copyright (c)", + "id": 272650, + "resource_url": "https://api.discogs.com/labels/272650" + }, + { + "name": "Pink Floyd Music Ltd.", + "catno": "", + "entity_type": "13", + "entity_type_name": "Phonographic Copyright (p)", + "id": 272650, + "resource_url": "https://api.discogs.com/labels/272650" + } + ], + "formats": [ + { + "name": "CD", + "qty": "1", + "descriptions": [ + "Album", + "Reissue" + ] + } + ], + "data_quality": "Needs Vote", + "community": { + "have": 155, + "want": 395, + "rating": { + "count": 8, + "average": 5 + }, + "submitter": { + "username": "jeff_spicoli", + "resource_url": "https://api.discogs.com/users/jeff_spicoli" + }, + "contributors": [ + { + "username": "jeff_spicoli", + "resource_url": "https://api.discogs.com/users/jeff_spicoli" + }, + { + "username": "appazappa", + "resource_url": "https://api.discogs.com/users/appazappa" + }, + { + "username": "XatMB", + "resource_url": "https://api.discogs.com/users/XatMB" + } + ], + "data_quality": "Needs Vote", + "status": "Accepted" + }, + "format_quantity": 1, + "date_added": "2020-11-14T18:34:46-08:00", + "date_changed": "2021-03-31T06:41:11-07:00", + "num_for_sale": 0, + "lowest_price": null, + "master_id": 11703, + "master_url": "https://api.discogs.com/masters/11703", + "title": "Wish You Were Here", + "country": "US", + "released": "1983", + "notes": "Release Information: First U.S. release with plain (sometimes referred to as \"crude\") matrix fonts. At the bottom of the label, it says: \"\"CBS\" [logo] are trademarks of CBS Inc.\" (this first issue does not say \"Made in Japan\" at the bottom of the label). On the back of the CD cover is a vertical white strip down the left side that has the \"Compact Disc Digital Audio\" logo at the top, nothing in the middle, and the bar code at the bottom. When inserted into a CD player, the player will read the number of tracks (or songs) as 2.\n\n\nFront cover:\n\"Record manufactured in Japan by CBS/Sony,Tokyo,Japan. © 1975 Pink Floyd Music Limited //℗ 1975 Pink Floyd Music Limited./Manufactured by CBS Records/CBS Inc./51 W.52 street, New York, N.Y./\"CBS,\" [trademark] are trademarks of CBS Inc./WARNING: All Rights Reserved. Unauthorized duplication is a violation of applicable laws.\"\n\nThe front cover is 1/4 of a two-times-folded leaf, which has the lyrics written on its unfolded back.\nThe inner front cover is the 2nd from 4 parts of that folding.\n\nAs found on the lyrics side of the two times folded cover leaf:\n\"Dick Parry saxophone on Shine On You Crazy Diamond\nRoy Harper vocal on Have a Cigar\nRecorded at Abbey Road Studios January to July 1975\nEngineered by Brian Humphries\nassisted by Peter James\nThanks to Bernie Caulder\nand Phil Taylor\nAll lyrics by Roger Waters\nProduced by Pink Floyd\n\nSleeve design and Photography\nby Hipgnosis assisted by Peter Christopherson\nJeffSmith Howard Bartrop\nand Richard Manning\nDye transfers by\nCombined Graphics and Simon Bell\nGraphics by George Hardie NTA\nAll selections © 1975 Pink Floyd Music\nPublishers Inc. (BMI). Used by permission.\nAll Rights Reserved.\n© 1975 Pink Floyd Limited\n33453\" \n", + "released_formatted": "1983", + "identifiers": [ + { + "type": "Barcode", + "value": "0 7464-33453-2", + "description": "Text" + }, + { + "type": "Barcode", + "value": "074643345323", + "description": "Scanned" + }, + { + "type": "Other", + "value": "MANUFACTURED BY CBS / SONY RECORDS INC.", + "description": "Engraved around center hole" + }, + { + "type": "Other", + "value": "DIDP 50004", + "description": "DADC - disc face" + }, + { + "type": "Matrix / Runout", + "value": "35DP-4-7 1A1 " + } + ], + "videos": [ + { + "uri": "https://www.youtube.com/watch?v=fn1R-5p_j5c", + "title": "Pink Floyd - Welcome to the Machine (Official Music Video)", + "description": "Welcome to the Machine is the second song on Pink Floyd's 1975 album Wish You Were Here. The song is said to be inspired by George Orwell's book 1984, in which a man is trying to escape the government which is brainwashing its citizens with TV shows and", + "duration": 464, + "embed": true + } + ], + "genres": [ + "Rock" + ], + "styles": [ + "Psychedelic Rock", + "Prog Rock" + ], + "tracklist": [ + { + "position": "", + "type_": "index", + "title": "Shine On You Crazy Diamond", + "extraartists": [ + { + "name": "Dick Parry", + "anv": "", + "join": "", + "role": "Saxophone", + "tracks": "", + "id": 251575, + "resource_url": "https://api.discogs.com/artists/251575" + } + ], + "duration": "13:28", + "sub_tracks": [ + { + "position": "1.1a", + "type_": "track", + "title": "Part I", + "duration": "" + }, + { + "position": "1.1b", + "type_": "track", + "title": "Part II", + "duration": "" + }, + { + "position": "1.1c", + "type_": "track", + "title": "Part III", + "duration": "" + }, + { + "position": "1.1d", + "type_": "track", + "title": "Part IV", + "duration": "" + }, + { + "position": "1.1e", + "type_": "track", + "title": "Part V", + "duration": "" + } + ] + }, + { + "position": "1.2", + "type_": "track", + "title": "Welcome To The Machine", + "duration": "7:35" + }, + { + "position": "2.1", + "type_": "track", + "title": "Have A Cigar", + "extraartists": [ + { + "name": "Roy Harper", + "anv": "", + "join": "", + "role": "Vocals", + "tracks": "", + "id": 252756, + "resource_url": "https://api.discogs.com/artists/252756" + } + ], + "duration": "5:06" + }, + { + "position": "2.2", + "type_": "track", + "title": "Wish You Were Here", + "duration": "5:37" + }, + { + "position": "", + "type_": "index", + "title": "Shine On You Crazy Diamond", + "extraartists": [ + { + "name": "Dick Parry", + "anv": "", + "join": "", + "role": "Saxophone", + "tracks": "", + "id": 251575, + "resource_url": "https://api.discogs.com/artists/251575" + } + ], + "duration": "12:27", + "sub_tracks": [ + { + "position": "2.3a", + "type_": "track", + "title": "Part VI", + "duration": "" + }, + { + "position": "2.3b", + "type_": "track", + "title": "Part VII", + "duration": "" + }, + { + "position": "2.3c", + "type_": "track", + "title": "Part VIII", + "duration": "" + }, + { + "position": "2.3d", + "type_": "track", + "title": "Part IX", + "duration": "" + } + ] + } + ], + "extraartists": [ + { + "name": "Brian Humphries", + "anv": "", + "join": "", + "role": "Engineer", + "tracks": "", + "id": 258792, + "resource_url": "https://api.discogs.com/artists/258792" + }, + { + "name": "Peter James", + "anv": "", + "join": "", + "role": "Engineer [Assistant]", + "tracks": "", + "id": 277864, + "resource_url": "https://api.discogs.com/artists/277864" + }, + { + "name": "Roger Waters", + "anv": "", + "join": "", + "role": "Lyrics By", + "tracks": "", + "id": 110862, + "resource_url": "https://api.discogs.com/artists/110862" + }, + { + "name": "David Gilmour", + "anv": "", + "join": "", + "role": "Music By", + "tracks": "1.1a to 1.1d, 1.2, 2.3a to 2.3d", + "id": 110863, + "resource_url": "https://api.discogs.com/artists/110863" + }, + { + "name": "Richard Wright", + "anv": "", + "join": "", + "role": "Music By", + "tracks": "1.1a to 1.1d, 2.3a to 2.3d", + "id": 110861, + "resource_url": "https://api.discogs.com/artists/110861" + }, + { + "name": "Roger Waters", + "anv": "", + "join": "", + "role": "Music By", + "tracks": "", + "id": 110862, + "resource_url": "https://api.discogs.com/artists/110862" + }, + { + "name": "Pink Floyd", + "anv": "", + "join": "", + "role": "Producer", + "tracks": "", + "id": 45467, + "resource_url": "https://api.discogs.com/artists/45467" + } + ], + "images": [ + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 598 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 524 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 623 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 605 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 450 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 450 + } + ], + "thumb": "", + "estimated_weight": 85, + "blocked_from_sale": false +} \ No newline at end of file diff --git a/tests/release.json b/tests/18051880.json similarity index 100% rename from tests/release.json rename to tests/18051880.json diff --git a/tests/21343819.json b/tests/21343819.json new file mode 100644 index 0000000..c0ddf21 --- /dev/null +++ b/tests/21343819.json @@ -0,0 +1,848 @@ +{ + "id": 21343819, + "status": "Accepted", + "year": 0, + "resource_url": "https://api.discogs.com/releases/21343819", + "uri": "https://www.discogs.com/release/21343819-Orchestre-Al-Brihi-De-F%C3%A8s-%D9%81%D8%B1%D9%82%D8%A9-%D8%A7%D9%84%D8%A8%D8%B1%D9%8A%D8%AD%D9%8A-%D8%A8%D9%81%D8%A7%D8%B3-Haj-Abdelkrim-Al-Ra%C3%AFs-%D8%A7%D9%84%D8%AD%D8%A7%D8%AC-%D8%B9%D8%A8%D8%AF", + "artists": [ + { + "name": "جوق البريهي", + "anv": "Orchestre Al-Brihi De Fès", + "join": "=", + "role": "", + "tracks": "", + "id": 6580186, + "resource_url": "https://api.discogs.com/artists/6580186" + }, + { + "name": "جوق البريهي", + "anv": "فرقة البريحي بفاس", + "join": ",", + "role": "", + "tracks": "", + "id": 6580186, + "resource_url": "https://api.discogs.com/artists/6580186" + }, + { + "name": "عبد الكريم الرايس", + "anv": "Haj Abdelkrim Al-Raïs", + "join": "=", + "role": "", + "tracks": "", + "id": 5254634, + "resource_url": "https://api.discogs.com/artists/5254634" + }, + { + "name": "عبد الكريم الرايس", + "anv": "الحاج عبد الكريم الرايس", + "join": "", + "role": "", + "tracks": "", + "id": 5254634, + "resource_url": "https://api.discogs.com/artists/5254634" + } + ], + "artists_sort": "جوق البريهي = جوق البريهي, عبد الكريم الرايس = عبد الكريم الرايس", + "labels": [ + { + "name": "Inedit", + "catno": "W 260010", + "entity_type": "1", + "entity_type_name": "Label", + "id": 113224, + "resource_url": "https://api.discogs.com/labels/113224" + }, + { + "name": "Maison Des Cultures Du Monde", + "catno": "W 260010", + "entity_type": "1", + "entity_type_name": "Label", + "id": 241417, + "resource_url": "https://api.discogs.com/labels/241417" + }, + { + "name": "Royaume Du Maroc Ministère De La Culture", + "catno": "W 260010", + "entity_type": "1", + "entity_type_name": "Label", + "id": 2483860, + "resource_url": "https://api.discogs.com/labels/2483860" + } + ], + "series": [ + { + "name": "Anthologie \"Al-âla\": Musique Andaluci-Marocaine", + "catno": "1", + "entity_type": "2", + "entity_type_name": "Series", + "id": 2518216, + "resource_url": "https://api.discogs.com/labels/2518216" + }, + { + "name": "أنطلوجية الآلـة : الموسيقى الاندلسية المغربية", + "catno": "1", + "entity_type": "2", + "entity_type_name": "Series", + "id": 2518219, + "resource_url": "https://api.discogs.com/labels/2518219" + } + ], + "companies": [ + { + "name": "Auvidis Distribution", + "catno": "", + "entity_type": "9", + "entity_type_name": "Distributed By", + "id": 465568, + "resource_url": "https://api.discogs.com/labels/465568" + }, + { + "name": "Studio Son Et Lumière", + "catno": "", + "entity_type": "23", + "entity_type_name": "Recorded At", + "id": 2518222, + "resource_url": "https://api.discogs.com/labels/2518222" + }, + { + "name": "Studio Adouaa Al Madina", + "catno": "", + "entity_type": "23", + "entity_type_name": "Recorded At", + "id": 503903, + "resource_url": "https://api.discogs.com/labels/503903" + }, + { + "name": "Translab", + "catno": "", + "entity_type": "36", + "entity_type_name": "Edited At", + "id": 191252, + "resource_url": "https://api.discogs.com/labels/191252" + }, + { + "name": "Ministère De La Culture Du Royaume Du Maroc", + "catno": "", + "entity_type": "14", + "entity_type_name": "Copyright (c)", + "id": 2483863, + "resource_url": "https://api.discogs.com/labels/2483863" + }, + { + "name": "Maison Des Cultures Du Monde", + "catno": "", + "entity_type": "14", + "entity_type_name": "Copyright (c)", + "id": 241417, + "resource_url": "https://api.discogs.com/labels/241417" + }, + { + "name": "Ministère De La Culture Du Royaume Du Maroc", + "catno": "", + "entity_type": "13", + "entity_type_name": "Phonographic Copyright (p)", + "id": 2483863, + "resource_url": "https://api.discogs.com/labels/2483863" + }, + { + "name": "Maison Des Cultures Du Monde", + "catno": "", + "entity_type": "13", + "entity_type_name": "Phonographic Copyright (p)", + "id": 241417, + "resource_url": "https://api.discogs.com/labels/241417" + }, + { + "name": "MPO", + "catno": "", + "entity_type": "16", + "entity_type_name": "Made By", + "id": 56025, + "resource_url": "https://api.discogs.com/labels/56025" + } + ], + "formats": [ + { + "name": "CD", + "qty": "6", + "descriptions": [ + "Reissue" + ] + } + ], + "data_quality": "Needs Vote", + "community": { + "have": 3, + "want": 5, + "rating": { + "count": 1, + "average": 5 + }, + "submitter": { + "username": "GrahamStewart", + "resource_url": "https://api.discogs.com/users/GrahamStewart" + }, + "contributors": [ + { + "username": "GrahamStewart", + "resource_url": "https://api.discogs.com/users/GrahamStewart" + } + ], + "data_quality": "Needs Vote", + "status": "Accepted" + }, + "format_quantity": 6, + "date_added": "2021-12-13T21:32:29-08:00", + "date_changed": "2021-12-13T22:49:00-08:00", + "num_for_sale": 2, + "lowest_price": 48.27, + "master_id": 2419945, + "master_url": "https://api.discogs.com/masters/2419945", + "title": "Nûbâ Gharîbat Al-Husayn = نوبة غريبة الحسين", + "country": "France", + "notes": "Enregistrement effectués du 15 au 19 mai 1989.\n© & ℗ 1989 [l2483863] et [l241417].\n℗ 1989 [url=https://www.discogs.com/label/241417]MCM[/url] (on CDs).\nMade in France by [l56025].\n\nReissue of [r5367319] with different colour cover and SID codes.\n6 CDs in a cardboard slip case containing 2 x 4-CD jewel cases. Also includes a 16 page booklet with liner notes in French, English, and Arabic.\nTrack durations are not provided.\nDurations as listed per CD:\nCD1: 56:13\nCD2: 58:57\nCD3: 62:40\nCD4: 59:12\nCD5: 67:30\nCD6: 57:15", + "identifiers": [ + { + "type": "Barcode", + "value": "3 298492 600106" + }, + { + "type": "Matrix / Runout", + "value": "W 260010 CD 1 MPO 01 @", + "description": "CD1" + }, + { + "type": "Mould SID Code", + "value": "IFPI 1225", + "description": "CD1" + }, + { + "type": "Matrix / Runout", + "value": "W 260010 CD 2 MPO 02 @ 01", + "description": "CD2" + }, + { + "type": "Mould SID Code", + "value": "IFPI 1225", + "description": "CD2" + }, + { + "type": "Matrix / Runout", + "value": "W 260010 CD 3 MPO 01 @@", + "description": "CD3" + }, + { + "type": "Mould SID Code", + "value": "IFPI 120B", + "description": "CD3" + }, + { + "type": "Matrix / Runout", + "value": "W 260010 CD 4 MPO 02 @", + "description": "CD4" + }, + { + "type": "Mould SID Code", + "value": "IFPI 120B", + "description": "CD4" + }, + { + "type": "Matrix / Runout", + "value": "W 260010 CD 5 MPO 01 @", + "description": "CD5" + }, + { + "type": "Mould SID Code", + "value": "IFPI 120B", + "description": "CD5" + }, + { + "type": "Matrix / Runout", + "value": "W 260010 CD 6 MPO 02 @@", + "description": "CD6" + }, + { + "type": "Mould SID Code", + "value": "IFPI 120B", + "description": "CD6" + }, + { + "type": "Price Code", + "value": "AD 440" + }, + { + "type": "Rights Society", + "value": "SACEM SACD SDRM SGDL" + } + ], + "videos": [ + { + "uri": "https://www.youtube.com/watch?v=RsG3Pw6l6gA", + "title": "Orchestre Al Brihi de Fès", + "description": "", + "duration": 402, + "embed": true + }, + { + "uri": "https://www.youtube.com/watch?v=QI9F-f3W6xE", + "title": "Qaym wa nusf, 2° mouvement (Bughya)", + "description": "Provided to YouTube by Inédit / Maison des cultures du monde\n\nQaym wa nusf, 2° mouvement (Bughya) · Orchestre al-Brihi de Fès · Haj Abdelkrim al-Raïs · DR.\n\nAnthologie al-âla, maroc : nuba al-hijaz al-msharqi (Musique andaluci-marocaine, version intégrale", + "duration": 92, + "embed": true + }, + { + "uri": "https://www.youtube.com/watch?v=E9xVEIquQ0Q", + "title": "Basit, 1° mouvement (Bughya, taba' hijaz al-msharqi, tushiya 1 & 2)", + "description": "Provided to YouTube by Inédit / Maison des cultures du monde\n\nBasit, 1° mouvement (Bughya, taba' hijaz al-msharqi, tushiya 1 & 2) · Orchestre al-Brihi de Fès · Haj Abdelkrim al-Raïs · DR.\n\nAnthologie al-âla, maroc : nuba al-hijaz al-msharqi (Musique andal", + "duration": 0, + "embed": true + }, + { + "uri": "https://www.youtube.com/watch?v=sZei_mqRY8Y", + "title": "Darj, 4° mouvement (Bughya)", + "description": "Provided to YouTube by Believe SAS\n\nDarj, 4° mouvement (Bughya) · Orchestre al-Brihi de Fès, Haj Abdelkrim al-Raïs\n\nAnthologie al-âla, Maroc : Nuba al-Hijaz al-Kebir (Musique andaluci-marocaine)\n\n℗ Maison des Cultures du Monde\n\nReleased on: 2014-08-18\n\nCo", + "duration": 147, + "embed": true + }, + { + "uri": "https://www.youtube.com/watch?v=RafgZFoyNVM", + "title": "Qaym wa nusf, 2° mouvement (Bughya, tushiya)", + "description": "Provided to YouTube by Believe SAS\n\nQaym wa nusf, 2° mouvement (Bughya, tushiya) · Orchestre al-Brihi de Fès, Haj Abdelkrim al-Raïs\n\nAnthologie al-âla, Maroc : Nuba al-Hijaz al-Kebir (Musique andaluci-marocaine)\n\n℗ Maison des Cultures du Monde\n\nReleased o", + "duration": 338, + "embed": true + }, + { + "uri": "https://www.youtube.com/watch?v=e11ZD9jYeNA", + "title": "Btayhi, 3° mouvement (Bughya)", + "description": "Provided to YouTube by Inédit / Maison des cultures du monde\n\nBtayhi, 3° mouvement (Bughya) · Orchestre al-Brihi de Fès · Haj Abdelkrim al-Raïs · DR.\n\nAnthologie al-âla, maroc : nuba al-hijaz al-msharqi (Musique andaluci-marocaine, version intégrale)\n\n℗ M", + "duration": 93, + "embed": true + } + ], + "genres": [ + "Folk, World, & Country" + ], + "styles": [ + "Andalusian Classical" + ], + "tracklist": [ + { + "position": "", + "type_": "index", + "title": "Premier Mîzân: Basît = First Mîzân: Basît", + "duration": "", + "sub_tracks": [ + { + "position": "1-1", + "type_": "track", + "title": "Bughya, Taba' Hijâz Al-msharqî, Tûshiya 1& 2", + "duration": "" + }, + { + "position": "1-2", + "type_": "track", + "title": "Tûshiya Chanté = Sung Tûshiya", + "duration": "" + }, + { + "position": "1-3", + "type_": "track", + "title": "Tûshiyat Al-Mîzân", + "duration": "" + }, + { + "position": "1-4", + "type_": "track", + "title": "San'a 1 À 6 = San'a 1 To 6", + "duration": "" + }, + { + "position": "2-1", + "type_": "track", + "title": "San'a 7 À 18 = San'a 7 To 18", + "duration": "" + } + ] + }, + { + "position": "", + "type_": "index", + "title": "Deuxième Mîzân: Qâym Wa Nusf = Second Mîzân: Qâym Wa Nusf", + "duration": "", + "sub_tracks": [ + { + "position": "2-2", + "type_": "track", + "title": "Inshâd", + "duration": "" + }, + { + "position": "2-3", + "type_": "track", + "title": "San'a 1, 2, 3", + "duration": "" + }, + { + "position": "3-1", + "type_": "track", + "title": "San'a 4 À 9 = San'a 4 To 9", + "duration": "" + } + ] + }, + { + "position": "", + "type_": "index", + "title": "Troisième Mîzân: Btâyhî = Third Mîzân: Btâyhî", + "duration": "", + "sub_tracks": [ + { + "position": "3-2", + "type_": "track", + "title": "Bughya", + "duration": "" + }, + { + "position": "3-3", + "type_": "track", + "title": "San'a 1, 2, 3", + "duration": "" + }, + { + "position": "4-1", + "type_": "track", + "title": "San'a 4 À 16 = San'a 4 To 16", + "duration": "" + } + ] + }, + { + "position": "", + "type_": "index", + "title": "Quatrième Mîzân: Darj = Fourth Mîzân: Darj", + "duration": "", + "sub_tracks": [ + { + "position": "4-2", + "type_": "track", + "title": "Inshâd", + "duration": "" + }, + { + "position": "4-3", + "type_": "track", + "title": "San'a 1 À 4 = San'a 1 To 4", + "duration": "" + }, + { + "position": "5-1", + "type_": "track", + "title": "San'a 5 À 10 = San'a 5 To 10", + "duration": "" + } + ] + }, + { + "position": "", + "type_": "index", + "title": "Cinquième Mîzân: Quddâm = Fifth Mîzân: Quddâm", + "duration": "", + "sub_tracks": [ + { + "position": "5-2", + "type_": "track", + "title": "Bughya", + "duration": "" + }, + { + "position": "5-3", + "type_": "track", + "title": "Tûshiyat Al-Mîzân", + "duration": "" + }, + { + "position": "5-4", + "type_": "track", + "title": "San'a 1 À 11 = San'a 1 To 11", + "duration": "" + }, + { + "position": "6-1", + "type_": "track", + "title": "San'a 12 À 30 = San'a 12 To 30", + "duration": "" + } + ] + } + ], + "extraartists": [ + { + "name": "أحمد تغشان", + "anv": "Ahmed Trachen", + "join": "", + "role": "Cello", + "tracks": "", + "id": 6580346, + "resource_url": "https://api.discogs.com/artists/6580346" + }, + { + "name": "Françoise Gründ", + "anv": "", + "join": "", + "role": "Editor [Collection Dirigée Par]", + "tracks": "", + "id": 945333, + "resource_url": "https://api.discogs.com/artists/945333" + }, + { + "name": "عبد الأحد العمري", + "anv": "Abdelahad Ameri", + "join": "", + "role": "Goblet Drum [Darbûka]", + "tracks": "", + "id": 6580343, + "resource_url": "https://api.discogs.com/artists/6580343" + }, + { + "name": "Joséphine De Linde", + "anv": "Josephine De Linde", + "join": "", + "role": "Liner Notes [Traduction Anglaise De La Notice]", + "tracks": "", + "id": 1791153, + "resource_url": "https://api.discogs.com/artists/1791153" + }, + { + "name": "Ahmed Aydoun", + "anv": "", + "join": "", + "role": "Liner Notes, Supervised By [Supervision Artistic]", + "tracks": "", + "id": 3135676, + "resource_url": "https://api.discogs.com/artists/3135676" + }, + { + "name": "عبد الرحيم العثماني", + "anv": "Abderrahim Otmani", + "join": "", + "role": "Oud ['Ud]", + "tracks": "", + "id": 6580337, + "resource_url": "https://api.discogs.com/artists/6580337" + }, + { + "name": "محمد بوزوبع", + "anv": "Mohamed Bouzouba", + "join": "", + "role": "Oud ['Ud]", + "tracks": "", + "id": 4826405, + "resource_url": "https://api.discogs.com/artists/4826405" + }, + { + "name": "Pierre Bois", + "anv": "", + "join": "", + "role": "Producer [Réalisation]", + "tracks": "", + "id": 1113602, + "resource_url": "https://api.discogs.com/artists/1113602" + }, + { + "name": "عبد الكريم الرايس", + "anv": "Haj Abdelkrim Al-Raïs", + "join": "", + "role": "Rebab [Rbâb], Conductor [Direction]", + "tracks": "", + "id": 5254634, + "resource_url": "https://api.discogs.com/artists/5254634" + }, + { + "name": "Pierre Simonin", + "anv": "", + "join": "", + "role": "Recorded By, Edited By", + "tracks": "", + "id": 417596, + "resource_url": "https://api.discogs.com/artists/417596" + }, + { + "name": "Abdel Wahab Agoumi", + "anv": "Abderrahim Souiri", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 4760220, + "resource_url": "https://api.discogs.com/artists/4760220" + }, + { + "name": "Abdelaziz Benabdejlil", + "anv": "", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 10410265, + "resource_url": "https://api.discogs.com/artists/10410265" + }, + { + "name": "Abdellatif Benmansour", + "anv": "", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 10410268, + "resource_url": "https://api.discogs.com/artists/10410268" + }, + { + "name": "Abdelmelek Chami", + "anv": "Pr Abdelmelek Chami", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 10410271, + "resource_url": "https://api.discogs.com/artists/10410271" + }, + { + "name": "Mohamed Attar", + "anv": "", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 983399, + "resource_url": "https://api.discogs.com/artists/983399" + }, + { + "name": "Mohammed Belmlih", + "anv": "Haj Mohammed Belmlih", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 10410274, + "resource_url": "https://api.discogs.com/artists/10410274" + }, + { + "name": "Mohammed Zniber", + "anv": "Dr Mohammed Zniber", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 10410277, + "resource_url": "https://api.discogs.com/artists/10410277" + }, + { + "name": "Moulay Idriss Ouazzani", + "anv": "My Driss Ouazzani", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 10410280, + "resource_url": "https://api.discogs.com/artists/10410280" + }, + { + "name": "Youness Chami", + "anv": "", + "join": "", + "role": "Supervised By [Supervision Artistic]", + "tracks": "", + "id": 10410283, + "resource_url": "https://api.discogs.com/artists/10410283" + }, + { + "name": "أحمد العربي", + "anv": "Ahmed Laabi", + "join": "", + "role": "Tar (Drum)", + "tracks": "", + "id": 6580340, + "resource_url": "https://api.discogs.com/artists/6580340" + }, + { + "name": "'ahmad Margawi", + "anv": "Ahmed Mergaoui", + "join": "", + "role": "Viola", + "tracks": "", + "id": 7141246, + "resource_url": "https://api.discogs.com/artists/7141246" + }, + { + "name": "إدريس بنيس", + "anv": "Idriss Bennis", + "join": "", + "role": "Viola", + "tracks": "", + "id": 6580338, + "resource_url": "https://api.discogs.com/artists/6580338" + }, + { + "name": "محمد التازي", + "anv": "Mohamed Tazi", + "join": "", + "role": "Viola", + "tracks": "", + "id": 6580407, + "resource_url": "https://api.discogs.com/artists/6580407" + }, + { + "name": "(3) محمد عرابي", + "anv": "Mohamed Larabi Gharnati", + "join": "", + "role": "Violin", + "tracks": "", + "id": 6580341, + "resource_url": "https://api.discogs.com/artists/6580341" + }, + { + "name": "التهامي السملالي", + "anv": "Thami Semlali", + "join": "", + "role": "Violin", + "tracks": "", + "id": 6580344, + "resource_url": "https://api.discogs.com/artists/6580344" + }, + { + "name": "محمد بريول", + "anv": "Mohamed Briouel", + "join": "", + "role": "Violin", + "tracks": "", + "id": 6580347, + "resource_url": "https://api.discogs.com/artists/6580347" + }, + { + "name": "عبد الرحيم الصويري", + "anv": "Souiri", + "join": "", + "role": "Vocals [Munshid]", + "tracks": "", + "id": 5114515, + "resource_url": "https://api.discogs.com/artists/5114515" + } + ], + "images": [ + { + "type": "primary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 523 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 525 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 1512 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 522 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 510 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 516 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 516 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 605 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 598 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 569 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 598 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 581 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 564 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 589 + }, + { + "type": "secondary", + "uri": "", + "resource_url": "", + "uri150": "", + "width": 600, + "height": 563 + } + ], + "thumb": "", + "estimated_weight": 510, + "blocked_from_sale": false +} \ No newline at end of file diff --git a/tests/test_discogs_tag.py b/tests/test_discogs_tag.py index a647e4b..bd4fb1d 100644 --- a/tests/test_discogs_tag.py +++ b/tests/test_discogs_tag.py @@ -39,10 +39,19 @@ def test_merge_metadata(): assert audio['date'] == '2002' def test_apply_metadata(): - with open('tests/release.json') as release: + with open('tests/18051880.json') as release: data = json.load(release) # Test that files must match API results. with pytest.raises(Exception) as error: - apply_metadata(data, [], { 'dry': False, 'ignore': False }) + apply_metadata(data, [], { 'dry': False, 'ignore': False, 'skip_subtrack': False }) assert "Expecting 28 files" in str(error.value) + +def test_count_subtracks(): + with open('tests/21343819.json') as release: + data = json.load(release) + + # Test that files must match API results. + with pytest.raises(Exception) as error: + apply_metadata(data, [], { 'dry': False, 'ignore': False, 'skip_subtrack': False }) + assert "Expecting 18 files" in str(error.value)