Samik081 / beets-beatport4

Beatport API v4 compatible beets plugin
MIT License
26 stars 2 forks source link

Key or BPM missing in Beatport API response #3

Closed JOJ0 closed 1 year ago

JOJ0 commented 1 year ago

Hi again, I've got another one. Sorry for the bad title. I don't know what's happening here. Even though I selected a candidate from Discogs, the beatport4 plug throws an error while trying to apply something around bpm. Just wild guessing it's got something to do with bpm being available from beatport api but now from discogs??

Get back to me if you'd like to have further details or debug prints in the code or something. Just reporting quick & dirty for now! Appologeeeez!

/remote/data/music-archive/0-andi/Dezember 2011 Beatport/Beatport Music/2662879_Air_Raz Remix.mp3 (1 items)
Tagging:
    Advanced Human - Air EP
URL:
    https://www.discogs.com/release/3079773-Advanced-Human-Air-EP
(Similarity: 78.8%) (missing tracks, tracks) (Discogs, Vinyl, 2011, Australia, Gynoid Audio, GYNOID.05)
 * Air - Raíz Remix -> Air (Raíz Remix) (title)
Missing tracks (3/4 - 75.0%):
 ! Air                       (# 1)
 ! Air (Ground Loop Remix)   (# 2)
 ! Air (Markus Suckut Remix) (# 3)
[A]pply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates, plaY? m
Finding tags for album "Advanced Human - Air EP".
Candidates:
1. Advanced Human - Air EP (78.8%) (missing tracks, tracks) (Discogs, Vinyl, 2011, Australia, Gynoid Audio, GYNOID.05)
2. Advanced Human - Air EP (74.1%) (missing tracks, tracks) (Discogs, File, 2011, Australia, Gynoid Audio, GYNOID.05)
3. Advanced Human - Drone Machine EP (47.9%) (album, year, missing tracks, ...) (Beatport, Digital, 2013, Starkstrom Schallplatten, SST016)
4. Advanced Human - Creational Forces (47.6%) (album, tracks, missing tracks, ...) (12" Vinyl, 2013, AU, Gynoid Limited, GYNLTD 005)
5. Advanced Human - Gamera Ep (46.0%) (missing tracks, album, tracks, ...) (Beatport, Digital, 2016, Counter Pulse, CP014)
6. Advanced Human - Grinding EP (43.6%) (missing tracks, album, tracks, ...) (Digital Media, 2014, NL, Dynamic Reflection, DREF020)
7. Advanced Human - Kyoto EP (41.8%) (album, missing tracks, year, ...) (Beatport, Digital, 2018, Counter Pulse, CP062D)
8. Advanced Human - Bullet Train EP (40.5%) (album, missing tracks, tracks, ...) (Beatport, Digital, 2019, Hypnotic Room, HROOM284)
9. Advanced Human - Prometheus Ep (38.6%) (album, missing tracks, year, ...) (Beatport, Digital, 2013, Android Muziq, ANDROIDREC008)
10. Unbalance - Distress EP (31.6%) (missing tracks, artist, album, ...) (Digital Media, 2011, AU, Gynoid Audio, GYNOIDD042)
11. Mark Morris & Logotech - Kaparezz EP (30.5%) (missing tracks, artist, album, ...) (Digital Media, 2013, XW, Gynoid Audio, GYNOIDD099)
12. Rraph - E404 EP (28.8%) (album, artist, missing tracks, ...) (Digital Media, 2016, XW, Gynoid Audio, gynoidd149)
13. Various - Avatar  (27.4%) (missing tracks, album, tracks, ...) (Discogs, Vinyl, 2014, Germany, Affin LTD, Affin 017 LTD)
# selection (default 1), Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates, plaY? 2
Tagging:
    Advanced Human - Air EP
URL:
    https://www.discogs.com/release/9808314-Advanced-Human-Air-EP
(Similarity: 74.1%) (missing tracks, tracks) (Discogs, File, 2011, Australia, Gynoid Audio, GYNOID.05)
 * Air - Raíz Remix -> Air (Raíz Remix) (title)
Missing tracks (4/5 - 80.0%):
 ! Air (Original Mix)             (# 1) (7:07)
 ! Air (Ground Loop's Echo Remix) (# 2) (5:51)
 ! Air (Markus Suckut Remix)      (# 3) (6:24)
 ! Air (Jin Hiyama Remix)         (# 5) (7:11)
Apply, More candidates, Skip, Use as-is, as Tracks, Group albums,
Enter search, enter Id, aBort, eDit, edit Candidates, plaY? a
Traceback (most recent call last):
  File "/home/jojo/.pyenv/versions/beets/bin/beet", line 33, in <module>
    sys.exit(load_entry_point('beets', 'console_scripts', 'beet')())
  File "/home/jojo/git/beets/beets/ui/__init__.py", line 1304, in main
    _raw_main(args)
  File "/home/jojo/git/beets/beets/ui/__init__.py", line 1291, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/home/jojo/git/beets/beets/ui/commands.py", line 1034, in import_func
    import_files(lib, paths, query)
  File "/home/jojo/git/beets/beets/ui/commands.py", line 974, in import_files
    session.run()
  File "/home/jojo/git/beets/beets/importer.py", line 340, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/home/jojo/git/beets/beets/util/pipeline.py", line 446, in run_parallel
    raise exc_info[1].with_traceback(exc_info[2])
  File "/home/jojo/git/beets/beets/util/pipeline.py", line 311, in run
    out = self.coro.send(msg)
  File "/home/jojo/git/beets/beets/util/pipeline.py", line 193, in coro
    func(*(args + (task,)))
  File "/home/jojo/git/beets/beets/importer.py", line 1408, in lookup_candidates
    task.lookup_candidates()
  File "/home/jojo/git/beets/beets/importer.py", line 661, in lookup_candidates
    autotag.tag_album(self.items, search_ids=self.search_ids)
  File "/home/jojo/git/beets/beets/autotag/match.py", line 461, in tag_album
    for matched_candidate in hooks.album_candidates(items,
  File "/home/jojo/git/beets/beets/plugins.py", line 573, in decorated
    for v in generator(*args, **kwargs):
  File "/home/jojo/git/beets/beets/autotag/hooks.py", line 632, in album_candidates
    yield from plugins.candidates(items, artist, album, va_likely, extra_tags)
  File "/home/jojo/git/beets/beets/plugins.py", line 384, in candidates
    yield from plugin.candidates(items, artist, album, va_likely,
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 524, in candidates
    return self._get_releases(query)
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 580, in _get_releases
    albums = [self._get_album_info(x)
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 580, in <listcomp>
    albums = [self._get_album_info(x)
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 338, in search
    yield self.get_release(release['id'])
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 354, in get_release
    release.tracks = self.get_release_tracks(beatport_id)
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 367, in get_release_tracks
    return [BeatportTrack(t) for t in response]
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 367, in <listcomp>
    return [BeatportTrack(t) for t in response]
  File "/home/jojo/git/beets-beatport4/beetsplug/beatport4.py", line 144, in __init__
    self.bpm = int(data['bpm'])
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'
Samik081 commented 1 year ago

Fixed in https://github.com/Samik081/beets-beatport4/releases/tag/v0.2.5