|
@@ -1,5 +1,19 @@
|
1
|
1
|
import os
|
2
|
|
-import discid
|
|
2
|
+import logging
|
|
3
|
+
|
|
4
|
+try:
|
|
5
|
+ from config import APP_NAME as ROOT_LOGGER_NAME
|
|
6
|
+except ImportError:
|
|
7
|
+ ROOT_LOGGER_NAME = 'root'
|
|
8
|
+logger = logging.getLogger(ROOT_LOGGER_NAME).getChild(__name__)
|
|
9
|
+
|
|
10
|
+# make module usable without discid dependency
|
|
11
|
+try:
|
|
12
|
+ import discid
|
|
13
|
+except ModuleNotFoundError:
|
|
14
|
+ logger.warning("Python module discid not installed")
|
|
15
|
+except OSError:
|
|
16
|
+ logger.exception("You might install python3-libdiscid")
|
3
|
17
|
|
4
|
18
|
KEY_ALBUM = 'album'
|
5
|
19
|
KEY_APERTURE = 'aperture'
|