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