malojaserver 3.2.1__py3-none-any.whl → 3.2.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- maloja/__main__.py +1 -1
- maloja/__pkginfo__.py +1 -1
- maloja/apis/_base.py +26 -19
- maloja/apis/_exceptions.py +1 -1
- maloja/apis/audioscrobbler.py +35 -7
- maloja/apis/audioscrobbler_legacy.py +5 -5
- maloja/apis/listenbrainz.py +7 -5
- maloja/apis/native_v1.py +43 -26
- maloja/cleanup.py +9 -7
- maloja/data_files/config/rules/predefined/krateng_kpopgirlgroups.tsv +4 -2
- maloja/database/__init__.py +55 -23
- maloja/database/associated.py +10 -6
- maloja/database/exceptions.py +28 -3
- maloja/database/sqldb.py +216 -168
- maloja/dev/profiler.py +3 -4
- maloja/images.py +6 -0
- maloja/malojauri.py +2 -0
- maloja/pkg_global/conf.py +97 -72
- maloja/proccontrol/tasks/export.py +2 -1
- maloja/proccontrol/tasks/import_scrobbles.py +57 -15
- maloja/server.py +4 -5
- maloja/setup.py +56 -44
- maloja/thirdparty/lastfm.py +18 -17
- maloja/web/jinja/abstracts/base.jinja +1 -1
- maloja/web/jinja/admin_albumless.jinja +2 -0
- maloja/web/jinja/admin_overview.jinja +3 -3
- maloja/web/jinja/admin_setup.jinja +1 -1
- maloja/web/jinja/error.jinja +2 -2
- maloja/web/jinja/partials/album_showcase.jinja +1 -1
- maloja/web/jinja/partials/awards_album.jinja +1 -1
- maloja/web/jinja/partials/awards_artist.jinja +2 -2
- maloja/web/jinja/partials/charts_albums_tiles.jinja +4 -0
- maloja/web/jinja/partials/charts_artists_tiles.jinja +5 -1
- maloja/web/jinja/partials/charts_tracks_tiles.jinja +4 -0
- maloja/web/jinja/snippets/entityrow.jinja +2 -2
- maloja/web/jinja/snippets/links.jinja +3 -1
- maloja/web/static/css/maloja.css +14 -2
- maloja/web/static/css/startpage.css +2 -2
- maloja/web/static/js/manualscrobble.js +1 -1
- maloja/web/static/js/notifications.js +16 -8
- {malojaserver-3.2.1.dist-info → malojaserver-3.2.3.dist-info}/METADATA +10 -46
- {malojaserver-3.2.1.dist-info → malojaserver-3.2.3.dist-info}/RECORD +45 -45
- {malojaserver-3.2.1.dist-info → malojaserver-3.2.3.dist-info}/WHEEL +1 -1
- {malojaserver-3.2.1.dist-info → malojaserver-3.2.3.dist-info}/LICENSE +0 -0
- {malojaserver-3.2.1.dist-info → malojaserver-3.2.3.dist-info}/entry_points.txt +0 -0
maloja/database/associated.py
CHANGED
@@ -19,12 +19,16 @@ def load_associated_rules():
|
|
19
19
|
|
20
20
|
# load from file
|
21
21
|
rawrules = []
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
22
|
+
try:
|
23
|
+
for f in os.listdir(data_dir["rules"]()):
|
24
|
+
if f.split('.')[-1].lower() != 'tsv': continue
|
25
|
+
filepath = data_dir["rules"](f)
|
26
|
+
with open(filepath,'r') as filed:
|
27
|
+
reader = csv.reader(filed,delimiter="\t")
|
28
|
+
rawrules += [[col for col in entry if col] for entry in reader if len(entry)>0 and not entry[0].startswith('#')]
|
29
|
+
except FileNotFoundError:
|
30
|
+
return
|
31
|
+
|
28
32
|
rules = [{'source_artist':r[1],'target_artist':r[2]} for r in rawrules if r[0]=="countas"]
|
29
33
|
|
30
34
|
#for rule in rules:
|
maloja/database/exceptions.py
CHANGED
@@ -1,37 +1,57 @@
|
|
1
1
|
from bottle import HTTPError
|
2
2
|
|
3
|
+
|
3
4
|
class EntityExists(Exception):
|
4
|
-
def __init__(self,entitydict):
|
5
|
+
def __init__(self, entitydict):
|
5
6
|
self.entitydict = entitydict
|
6
7
|
|
7
8
|
|
8
9
|
class TrackExists(EntityExists):
|
9
10
|
pass
|
10
11
|
|
12
|
+
|
11
13
|
class ArtistExists(EntityExists):
|
12
14
|
pass
|
13
15
|
|
16
|
+
|
14
17
|
class AlbumExists(EntityExists):
|
15
18
|
pass
|
16
19
|
|
20
|
+
|
21
|
+
# if the scrobbles dont match
|
22
|
+
class DuplicateTimestamp(Exception):
|
23
|
+
def __init__(self, existing_scrobble, rejected_scrobble):
|
24
|
+
self.existing_scrobble = existing_scrobble
|
25
|
+
self.rejected_scrobble = rejected_scrobble
|
26
|
+
|
27
|
+
|
28
|
+
# if it's the same scrobble
|
29
|
+
class DuplicateScrobble(Exception):
|
30
|
+
def __init__(self, scrobble):
|
31
|
+
self.scrobble = scrobble
|
32
|
+
|
33
|
+
|
17
34
|
class DatabaseNotBuilt(HTTPError):
|
18
35
|
def __init__(self):
|
19
36
|
super().__init__(
|
20
37
|
status=503,
|
21
38
|
body="The Maloja Database is being upgraded to support new Maloja features. This could take a while.",
|
22
|
-
headers={"Retry-After":120}
|
39
|
+
headers={"Retry-After": 120}
|
23
40
|
)
|
24
41
|
|
25
42
|
|
26
43
|
class MissingScrobbleParameters(Exception):
|
27
|
-
def __init__(self,params=[]):
|
44
|
+
def __init__(self, params=[]):
|
28
45
|
self.params = params
|
29
46
|
|
47
|
+
|
30
48
|
class MissingEntityParameter(Exception):
|
31
49
|
pass
|
32
50
|
|
51
|
+
|
33
52
|
class EntityDoesNotExist(HTTPError):
|
34
53
|
entitytype = 'Entity'
|
54
|
+
|
35
55
|
def __init__(self,entitydict):
|
36
56
|
self.entitydict = entitydict
|
37
57
|
super().__init__(
|
@@ -39,9 +59,14 @@ class EntityDoesNotExist(HTTPError):
|
|
39
59
|
body=f"The {self.entitytype} '{self.entitydict}' does not exist in the database."
|
40
60
|
)
|
41
61
|
|
62
|
+
|
42
63
|
class ArtistDoesNotExist(EntityDoesNotExist):
|
43
64
|
entitytype = 'Artist'
|
65
|
+
|
66
|
+
|
44
67
|
class AlbumDoesNotExist(EntityDoesNotExist):
|
45
68
|
entitytype = 'Album'
|
69
|
+
|
70
|
+
|
46
71
|
class TrackDoesNotExist(EntityDoesNotExist):
|
47
72
|
entitytype = 'Track'
|