malojaserver 3.2.2__py3-none-any.whl → 3.2.3__py3-none-any.whl

Sign up to get free protection for your applications and to get access to all the features.
Files changed (38) hide show
  1. maloja/__main__.py +1 -1
  2. maloja/__pkginfo__.py +1 -1
  3. maloja/apis/_base.py +26 -19
  4. maloja/apis/_exceptions.py +1 -1
  5. maloja/apis/audioscrobbler.py +35 -7
  6. maloja/apis/audioscrobbler_legacy.py +5 -5
  7. maloja/apis/listenbrainz.py +7 -5
  8. maloja/apis/native_v1.py +43 -26
  9. maloja/cleanup.py +9 -7
  10. maloja/data_files/config/rules/predefined/krateng_kpopgirlgroups.tsv +2 -2
  11. maloja/database/__init__.py +55 -23
  12. maloja/database/associated.py +10 -6
  13. maloja/database/exceptions.py +28 -3
  14. maloja/database/sqldb.py +216 -168
  15. maloja/dev/profiler.py +3 -4
  16. maloja/images.py +6 -0
  17. maloja/malojauri.py +2 -0
  18. maloja/pkg_global/conf.py +29 -28
  19. maloja/proccontrol/tasks/export.py +2 -1
  20. maloja/proccontrol/tasks/import_scrobbles.py +57 -15
  21. maloja/server.py +4 -5
  22. maloja/setup.py +13 -7
  23. maloja/web/jinja/abstracts/base.jinja +1 -1
  24. maloja/web/jinja/admin_albumless.jinja +2 -0
  25. maloja/web/jinja/admin_overview.jinja +3 -3
  26. maloja/web/jinja/admin_setup.jinja +1 -1
  27. maloja/web/jinja/partials/album_showcase.jinja +1 -1
  28. maloja/web/jinja/snippets/entityrow.jinja +2 -2
  29. maloja/web/jinja/snippets/links.jinja +3 -1
  30. maloja/web/static/css/maloja.css +8 -2
  31. maloja/web/static/css/startpage.css +2 -2
  32. maloja/web/static/js/manualscrobble.js +1 -1
  33. maloja/web/static/js/notifications.js +16 -8
  34. {malojaserver-3.2.2.dist-info → malojaserver-3.2.3.dist-info}/METADATA +10 -46
  35. {malojaserver-3.2.2.dist-info → malojaserver-3.2.3.dist-info}/RECORD +38 -38
  36. {malojaserver-3.2.2.dist-info → malojaserver-3.2.3.dist-info}/WHEEL +1 -1
  37. {malojaserver-3.2.2.dist-info → malojaserver-3.2.3.dist-info}/LICENSE +0 -0
  38. {malojaserver-3.2.2.dist-info → malojaserver-3.2.3.dist-info}/entry_points.txt +0 -0
@@ -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'