1
0
mirror of https://github.com/krateng/maloja.git synced 2023-08-10 21:12:55 +03:00

Compare commits

...

10 Commits

Author SHA1 Message Date
krateng
62208bf668 Merge branch 'feature-restructure' into feature-webedit 2022-04-20 19:10:41 +02:00
krateng
53bc856222 Merge branch 'master' into feature-restructure 2022-04-20 19:08:16 +02:00
krateng
43ec4c2c9e Reenabled bracket normalization for titles, GH-121 2022-04-19 22:13:51 +02:00
krateng
17be00f794 Improved parsing of featuring artists in square brackets, fix GH-121 2022-04-19 15:22:42 +02:00
krateng
fe21894c5e Version bump 2022-04-19 02:41:39 +02:00
krateng
2bb3fa12b3
Merge pull request #119 from northys/patch-1
README.md: fix docker image name
2022-04-19 00:13:54 +02:00
krateng
32a900cf37 Fixed error for Lastfm import and added feedback, fix GH-118 2022-04-19 00:11:40 +02:00
krateng
397eaf668f Moved static areas together in jinja base template 2022-04-18 23:34:53 +02:00
northys
80ba4550c7
README.md: fix docker image name 2022-04-18 22:37:27 +02:00
krateng
c9d2527a98 Added changelog 2022-04-17 15:37:48 +02:00
8 changed files with 35 additions and 16 deletions

View File

@ -97,7 +97,7 @@ You must publish a port on your host machine to bind to the container's web port
An example of a minimum run configuration to access maloja via `localhost:42010`:
```console
docker run -p 42010:42010 -v $PWD/malojadata:/mljdata -e MALOJA_DATA_DIRECTORY=/mljdata maloja
docker run -p 42010:42010 -v $PWD/malojadata:/mljdata -e MALOJA_DATA_DIRECTORY=/mljdata krateng/maloja
```
### Extras

View File

@ -28,3 +28,11 @@ minor_release_name: "Yeonhee"
- "[Feature] Added better feedback to native API endpoints"
- "[Bugfix] Fixed native API receiving superfluous keywords"
- "[Bugfix] Fixed crash when importing scrobbles with artists with similar names"
3.0.5:
commit: "fe21894c5ecf3a53c9c5c00453abfc7f41c6a83e"
notes:
- "[Feature] Added notification system for web interface"
- "[Bugfix] Fixed crash when encountering error in Lastfm import"
3.0.6:
notes:
- "[Bugfix] Better parsing of featuring artists"

View File

@ -1,2 +1,3 @@
- "[Architecture] Cleaned up legacy process control"
- "[Feature] Implemented track title and artist name editing from web interface"
- "[Feature] Implemented track and artist merging from web interface"

View File

@ -4,7 +4,7 @@
# you know what f*ck it
# this is hardcoded for now because of that damn project / package name discrepancy
# i'll fix it one day
VERSION = "3.0.4"
VERSION = "3.0.5"
HOMEPAGE = "https://github.com/krateng/maloja"

View File

@ -109,9 +109,9 @@ class CleanerAgent:
for d in self.delimiters_feat:
if re.match(r"(.*) \(" + d + " (.*)\)",a) is not None:
return self.parseArtists(re.sub(r"(.*) \(" + d + " (.*)\)",r"\1",a)) + \
self.parseArtists(re.sub(r"(.*) \(" + d + " (.*)\)",r"\2",a))
if re.match(r"(.*) [\(\[]" + d + " (.*)[\)\]]",a) is not None:
return self.parseArtists(re.sub(r"(.*) [\(\[]" + d + " (.*)[\)\]]",r"\1",a)) + \
self.parseArtists(re.sub(r"(.*) [\(\[]" + d + " (.*)[\)\]]",r"\2",a))
@ -141,9 +141,11 @@ class CleanerAgent:
t = t.replace("[","(").replace("]",")")
t = re.sub(r" \(as made famous by .*?\)","",t)
t = re.sub(r" \(originally by .*?\)","",t)
t = re.sub(r" \(.*?Remaster.*?\)","",t)
# we'll leave these matching all bracket types so future changes
# won't require readaption
t = re.sub(r" [\(\[]as made famous by .*?[\)\]]","",t)
t = re.sub(r" [\(\[]originally by .*?[\)\]]","",t)
t = re.sub(r" [\(\[].*?Remaster.*?[\)\]]","",t)
for s in malojaconfig["REMOVE_FROM_TITLE"]:
if s in t:
@ -156,9 +158,9 @@ class CleanerAgent:
def parseTitleForArtists(self,t):
for d in self.delimiters_feat:
if re.match(r"(.*) \(" + d + " (.*?)\)",t) is not None:
(title,artists) = self.parseTitleForArtists(re.sub(r"(.*) \(" + d + " (.*?)\)",r"\1",t))
artists += self.parseArtists(re.sub(r"(.*) \(" + d + " (.*?)\).*",r"\2",t))
if re.match(r"(.*) [\(\[]" + d + " (.*?)[\)\]]",t) is not None:
(title,artists) = self.parseTitleForArtists(re.sub(r"(.*) [\(\[]" + d + " (.*?)[\)\]]",r"\1",t))
artists += self.parseArtists(re.sub(r"(.*) [\(\[]" + d + " (.*?)[\)\]].*",r"\2",t))
return (title,artists)
if re.match(r"(.*) - " + d + " (.*)",t) is not None:
(title,artists) = self.parseTitleForArtists(re.sub(r"(.*) - " + d + " (.*)",r"\1",t))

View File

@ -268,11 +268,17 @@ def parse_lastfm(inputf):
with open(inputf,'r',newline='') as inputfd:
reader = csv.reader(inputfd)
line = 0
for row in reader:
line += 1
try:
artist,album,title,time = row
except ValueError:
yield ('FAIL',None,f"{row} does not look like a valid entry. Scrobble not imported.")
yield ('FAIL',None,f"{row} (Line {line}) does not look like a valid entry. Scrobble not imported.")
continue
if time == '':
yield ('FAIL',None,f"{row} (Line {line}) is missing a timestamp.")
continue
try:
@ -287,7 +293,7 @@ def parse_lastfm(inputf):
'scrobble_duration':None
},'')
except Exception as e:
yield ('FAIL',None,f"{entry} could not be parsed. Scrobble not imported. ({repr(e)})")
yield ('FAIL',None,f"{row} (Line {line}) could not be parsed. Scrobble not imported. ({repr(e)})")
continue

View File

@ -50,9 +50,7 @@
{% endblock %}
{% endblock %}
<div id="notification_area">
</div>
<div class="footer">
@ -89,6 +87,10 @@
{% include 'icons/settings.jinja' %}
</div>
<div id="notification_area">
</div>
</body>
</html>

View File

@ -1,6 +1,6 @@
[project]
name = "malojaserver"
version = "3.0.4"
version = "3.0.5"
description = "Self-hosted music scrobble database"
readme = "./README.md"
requires-python = ">=3.6"