post-refactor fixes
This commit is contained in:
parent
da53b4e153
commit
0d2f9a9587
|
@ -1,3 +1,4 @@
|
||||||
|
import os
|
||||||
import logging
|
import logging
|
||||||
import subprocess
|
import subprocess
|
||||||
from time import time
|
from time import time
|
||||||
|
@ -171,7 +172,7 @@ class PysonicSubsonicApi(object):
|
||||||
maxBitRate = int(maxBitRate)
|
maxBitRate = int(maxBitRate)
|
||||||
assert maxBitRate >= 32 and maxBitRate <= 320
|
assert maxBitRate >= 32 and maxBitRate <= 320
|
||||||
song = self.db.get_songs(id=int(id))[0]
|
song = self.db.get_songs(id=int(id))[0]
|
||||||
fpath = song["_fullpath"]
|
fpath = os.path.join(song["root"], song["file"])
|
||||||
media_bitrate = song.get("bitrate") / 1024 if song.get("bitrate") else 320
|
media_bitrate = song.get("bitrate") / 1024 if song.get("bitrate") else 320
|
||||||
to_bitrate = min(maxBitRate,
|
to_bitrate = min(maxBitRate,
|
||||||
self.options.max_bitrate,
|
self.options.max_bitrate,
|
||||||
|
|
|
@ -312,12 +312,15 @@ class PysonicDatabase(object):
|
||||||
q = """
|
q = """
|
||||||
SELECT
|
SELECT
|
||||||
s.*,
|
s.*,
|
||||||
|
lib.path as root,
|
||||||
alb.name as albumname,
|
alb.name as albumname,
|
||||||
alb.coverid as albumcoverid,
|
alb.coverid as albumcoverid,
|
||||||
art.name as artistname,
|
art.name as artistname,
|
||||||
g.name as genrename,
|
g.name as genrename,
|
||||||
albdir.id as albumdir
|
albdir.id as albumdir
|
||||||
FROM songs as s
|
FROM songs as s
|
||||||
|
INNER JOIN libraries as lib
|
||||||
|
on s.library == lib.id
|
||||||
INNER JOIN albums as alb
|
INNER JOIN albums as alb
|
||||||
on s.albumid == alb.id
|
on s.albumid == alb.id
|
||||||
INNER JOIN dirs as albdir
|
INNER JOIN dirs as albdir
|
||||||
|
|
Loading…
Reference in New Issue