File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 20
20
21
21
import http .client
22
22
import json
23
+ import logging
23
24
import os
24
25
import re
25
26
import socket
31
32
32
33
import confuse
33
34
from discogs_client import Client , Master , Release
34
- from discogs_client .exceptions import DiscogsAPIError
35
+ from discogs_client .exceptions import DiscogsAPIError , HTTPError
35
36
from requests .exceptions import ConnectionError
36
37
from typing_extensions import TypedDict
37
38
46
47
from collections .abc import Callable , Iterable
47
48
48
49
from beets .library import Item
50
+ # Global logger.
51
+ log = logging .getLogger ("beets" )
49
52
50
53
USER_AGENT = f"beets/{ beets .__version__ } +https://beets.io/"
51
54
API_KEY = "rAzVUQYRaoFjeBjyWuWZ"
@@ -305,7 +308,13 @@ def get_album_info(self, result):
305
308
# Explicitly reload the `Release` fields, as they might not be yet
306
309
# present if the result is from a `discogs_client.search()`.
307
310
if not result .data .get ("artists" ):
308
- result .refresh ()
311
+ try :
312
+ result .refresh ()
313
+ except HTTPError as exc :
314
+ if exc .status_code == 404 :
315
+ log .debug ("Request not found: {0}: {1}" , result , exc )
316
+ else :
317
+ raise
309
318
310
319
# Sanity check for required fields. The list of required fields is
311
320
# defined at Guideline 1.3.1.a, but in practice some releases might be
You can’t perform that action at this time.
0 commit comments