mirror of
https://github.com/krateng/maloja.git
synced 2025-07-09 03:04:07 -04:00
Merge branch 'master' into feature-restructure
This commit is contained in:
commit
53bc856222
@ -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`:
|
An example of a minimum run configuration to access maloja via `localhost:42010`:
|
||||||
|
|
||||||
```console
|
```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
|
### Extras
|
||||||
|
@ -4,6 +4,7 @@ minor_release_name: "Yeonhee"
|
|||||||
notes:
|
notes:
|
||||||
- "[Architecture] Switched to SQLite for main database"
|
- "[Architecture] Switched to SQLite for main database"
|
||||||
- "[Architecture] Switched to SQLite for artwork cache"
|
- "[Architecture] Switched to SQLite for artwork cache"
|
||||||
|
- "[Feature] Added scrobble deletion from web interface"
|
||||||
3.0.1:
|
3.0.1:
|
||||||
commit: "700b81217cb585df631d6f069243c56074cd1b71"
|
commit: "700b81217cb585df631d6f069243c56074cd1b71"
|
||||||
notes:
|
notes:
|
||||||
@ -27,3 +28,11 @@ minor_release_name: "Yeonhee"
|
|||||||
- "[Feature] Added better feedback to native API endpoints"
|
- "[Feature] Added better feedback to native API endpoints"
|
||||||
- "[Bugfix] Fixed native API receiving superfluous keywords"
|
- "[Bugfix] Fixed native API receiving superfluous keywords"
|
||||||
- "[Bugfix] Fixed crash when importing scrobbles with artists with similar names"
|
- "[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"
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
# you know what f*ck it
|
# you know what f*ck it
|
||||||
# this is hardcoded for now because of that damn project / package name discrepancy
|
# this is hardcoded for now because of that damn project / package name discrepancy
|
||||||
# i'll fix it one day
|
# i'll fix it one day
|
||||||
VERSION = "3.0.4"
|
VERSION = "3.0.5"
|
||||||
HOMEPAGE = "https://github.com/krateng/maloja"
|
HOMEPAGE = "https://github.com/krateng/maloja"
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,9 +109,9 @@ class CleanerAgent:
|
|||||||
|
|
||||||
|
|
||||||
for d in self.delimiters_feat:
|
for d in self.delimiters_feat:
|
||||||
if re.match(r"(.*) \(" + d + " (.*)\)",a) is not None:
|
if re.match(r"(.*) [\(\[]" + d + " (.*)[\)\]]",a) is not None:
|
||||||
return self.parseArtists(re.sub(r"(.*) \(" + d + " (.*)\)",r"\1",a)) + \
|
return self.parseArtists(re.sub(r"(.*) [\(\[]" + d + " (.*)[\)\]]",r"\1",a)) + \
|
||||||
self.parseArtists(re.sub(r"(.*) \(" + d + " (.*)\)",r"\2",a))
|
self.parseArtists(re.sub(r"(.*) [\(\[]" + d + " (.*)[\)\]]",r"\2",a))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -141,9 +141,11 @@ class CleanerAgent:
|
|||||||
|
|
||||||
t = t.replace("[","(").replace("]",")")
|
t = t.replace("[","(").replace("]",")")
|
||||||
|
|
||||||
t = re.sub(r" \(as made famous by .*?\)","",t)
|
# we'll leave these matching all bracket types so future changes
|
||||||
t = re.sub(r" \(originally by .*?\)","",t)
|
# won't require readaption
|
||||||
t = re.sub(r" \(.*?Remaster.*?\)","",t)
|
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"]:
|
for s in malojaconfig["REMOVE_FROM_TITLE"]:
|
||||||
if s in t:
|
if s in t:
|
||||||
@ -156,9 +158,9 @@ class CleanerAgent:
|
|||||||
|
|
||||||
def parseTitleForArtists(self,t):
|
def parseTitleForArtists(self,t):
|
||||||
for d in self.delimiters_feat:
|
for d in self.delimiters_feat:
|
||||||
if re.match(r"(.*) \(" + d + " (.*?)\)",t) is not None:
|
if re.match(r"(.*) [\(\[]" + d + " (.*?)[\)\]]",t) is not None:
|
||||||
(title,artists) = self.parseTitleForArtists(re.sub(r"(.*) \(" + d + " (.*?)\)",r"\1",t))
|
(title,artists) = self.parseTitleForArtists(re.sub(r"(.*) [\(\[]" + d + " (.*?)[\)\]]",r"\1",t))
|
||||||
artists += self.parseArtists(re.sub(r"(.*) \(" + d + " (.*?)\).*",r"\2",t))
|
artists += self.parseArtists(re.sub(r"(.*) [\(\[]" + d + " (.*?)[\)\]].*",r"\2",t))
|
||||||
return (title,artists)
|
return (title,artists)
|
||||||
if re.match(r"(.*) - " + d + " (.*)",t) is not None:
|
if re.match(r"(.*) - " + d + " (.*)",t) is not None:
|
||||||
(title,artists) = self.parseTitleForArtists(re.sub(r"(.*) - " + d + " (.*)",r"\1",t))
|
(title,artists) = self.parseTitleForArtists(re.sub(r"(.*) - " + d + " (.*)",r"\1",t))
|
||||||
|
@ -268,11 +268,17 @@ def parse_lastfm(inputf):
|
|||||||
with open(inputf,'r',newline='') as inputfd:
|
with open(inputf,'r',newline='') as inputfd:
|
||||||
reader = csv.reader(inputfd)
|
reader = csv.reader(inputfd)
|
||||||
|
|
||||||
|
line = 0
|
||||||
for row in reader:
|
for row in reader:
|
||||||
|
line += 1
|
||||||
try:
|
try:
|
||||||
artist,album,title,time = row
|
artist,album,title,time = row
|
||||||
except ValueError:
|
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
|
continue
|
||||||
|
|
||||||
try:
|
try:
|
||||||
@ -287,7 +293,7 @@ def parse_lastfm(inputf):
|
|||||||
'scrobble_duration':None
|
'scrobble_duration':None
|
||||||
},'')
|
},'')
|
||||||
except Exception as e:
|
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
|
continue
|
||||||
|
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
<script src="/search.js"></script>
|
<script src="/search.js"></script>
|
||||||
<script src="/neopolitan.js"></script>
|
<script src="/neopolitan.js"></script>
|
||||||
<script src="/upload.js"></script>
|
<script src="/upload.js"></script>
|
||||||
|
<script src="/notifications.js"></script>
|
||||||
|
|
||||||
<link rel="preload" href="/static/ttf/Ubuntu-Regular.ttf" as="font" type="font/woff2" crossorigin />
|
<link rel="preload" href="/static/ttf/Ubuntu-Regular.ttf" as="font" type="font/woff2" crossorigin />
|
||||||
|
|
||||||
@ -49,6 +50,9 @@
|
|||||||
{% endblock %}
|
{% endblock %}
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
<div id="notification_area">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
<div class="footer">
|
<div class="footer">
|
||||||
|
@ -185,6 +185,29 @@ div.searchresults table.searchresults_tracks td span:nth-child(1) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
Notifications
|
||||||
|
**/
|
||||||
|
|
||||||
|
div#notification_area {
|
||||||
|
position: fixed;
|
||||||
|
width:420px;
|
||||||
|
bottom:40px;
|
||||||
|
right:20px;
|
||||||
|
}
|
||||||
|
div#notification_area div.notification {
|
||||||
|
background-color:white;
|
||||||
|
width:400px;
|
||||||
|
height:100px;
|
||||||
|
margin-bottom:7px;
|
||||||
|
padding:9px;
|
||||||
|
opacity:0.4;
|
||||||
|
}
|
||||||
|
div#notification_area div.notification:hover {
|
||||||
|
opacity:0.95;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@media (max-width: 1000px) {
|
@media (max-width: 1000px) {
|
||||||
|
|
||||||
div.footer {
|
div.footer {
|
||||||
|
35
maloja/web/static/js/notifications.js
Normal file
35
maloja/web/static/js/notifications.js
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
// JS for feedback to the user whenever any XHTTP action is taken
|
||||||
|
|
||||||
|
const colors = {
|
||||||
|
'warning':'red',
|
||||||
|
'info':'green'
|
||||||
|
}
|
||||||
|
|
||||||
|
const notification_template = info => `
|
||||||
|
<div class="notification" style="background-color:${colors[type]};">
|
||||||
|
<b>${info.title}</b><br/>
|
||||||
|
<span>${info.body}</span>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
`
|
||||||
|
|
||||||
|
function htmlToElement(html) {
|
||||||
|
template = document.createElement('template');
|
||||||
|
html = html.trim();
|
||||||
|
template.innerHTML = html;
|
||||||
|
return template.content.firstChild;
|
||||||
|
}
|
||||||
|
|
||||||
|
function notify(title,msg,type='info',reload=false) {
|
||||||
|
info = {
|
||||||
|
'title':title,
|
||||||
|
'body':msg,
|
||||||
|
'type':type
|
||||||
|
}
|
||||||
|
|
||||||
|
var element = htmlToElement(notification_template(info));
|
||||||
|
|
||||||
|
document.getElementById('notification_area').append(element);
|
||||||
|
|
||||||
|
setTimeout(function(e){e.remove();},7000,element);
|
||||||
|
}
|
@ -1,6 +1,6 @@
|
|||||||
[project]
|
[project]
|
||||||
name = "malojaserver"
|
name = "malojaserver"
|
||||||
version = "3.0.4"
|
version = "3.0.5"
|
||||||
description = "Self-hosted music scrobble database"
|
description = "Self-hosted music scrobble database"
|
||||||
readme = "./README.md"
|
readme = "./README.md"
|
||||||
requires-python = ">=3.6"
|
requires-python = ">=3.6"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user