fix track ordering
This commit is contained in:
parent
8340bb3c61
commit
33f17887c2
|
@ -143,6 +143,7 @@ class PysonicSubsonicApi(object):
|
||||||
duration=child["length"],
|
duration=child["length"],
|
||||||
isDir="false",
|
isDir="false",
|
||||||
parent=entity["dir"],
|
parent=entity["dir"],
|
||||||
|
track=child["track"],
|
||||||
# title=xxx
|
# title=xxx
|
||||||
)
|
)
|
||||||
if entity["coverid"]:
|
if entity["coverid"]:
|
||||||
|
|
|
@ -24,8 +24,8 @@ def main():
|
||||||
group = parser.add_argument_group("app options")
|
group = parser.add_argument_group("app options")
|
||||||
group.add_argument("--skip-transcode", action="store_true", help="instead of trancoding mp3s, send as-is")
|
group.add_argument("--skip-transcode", action="store_true", help="instead of trancoding mp3s, send as-is")
|
||||||
group.add_argument("--no-rescan", action="store_true", help="don't perform simple scan on startup")
|
group.add_argument("--no-rescan", action="store_true", help="don't perform simple scan on startup")
|
||||||
group.add_argument("--deep-rescap", action="store_true", help="perform deep scan (read id3 etc)")
|
# group.add_argument("--deep-rescan", action="store_true", help="perform deep scan (read id3 etc)")
|
||||||
group.add_argument("--enable-prune", action="store_true", help="enable removal of media not found on disk")
|
# group.add_argument("--enable-prune", action="store_true", help="enable removal of media not found on disk")
|
||||||
group.add_argument("--max-bitrate", type=int, default=320, help="maximum send bitrate")
|
group.add_argument("--max-bitrate", type=int, default=320, help="maximum send bitrate")
|
||||||
group.add_argument("--enable-cors", action="store_true", help="add response headers to allow cors")
|
group.add_argument("--enable-cors", action="store_true", help="add response headers to allow cors")
|
||||||
|
|
||||||
|
@ -37,7 +37,8 @@ def main():
|
||||||
db = PysonicDatabase(path=args.database_path)
|
db = PysonicDatabase(path=args.database_path)
|
||||||
library = PysonicLibrary(db)
|
library = PysonicLibrary(db)
|
||||||
for dirname in args.dirs:
|
for dirname in args.dirs:
|
||||||
assert os.path.exists(dirname) and dirname.startswith("/"), "--dirs must be absolute paths and exist!"
|
dirname = os.path.abspath(dirname)
|
||||||
|
assert os.path.exists(dirname), "--dirs must be paths that exist"
|
||||||
try:
|
try:
|
||||||
library.add_root_dir(dirname)
|
library.add_root_dir(dirname)
|
||||||
except DuplicateRootException:
|
except DuplicateRootException:
|
||||||
|
@ -60,7 +61,6 @@ def main():
|
||||||
logging.warning("starting up with auth disabled")
|
logging.warning("starting up with auth disabled")
|
||||||
else:
|
else:
|
||||||
def validate_password(realm, username, password):
|
def validate_password(realm, username, password):
|
||||||
print("I JUST VALIDATED {}:{} ({})".format(username, password, realm))
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
api_config.update({'tools.auth_basic.on': True,
|
api_config.update({'tools.auth_basic.on': True,
|
||||||
|
|
|
@ -38,7 +38,7 @@ def readcursor(func):
|
||||||
return func(*args, **kwargs)
|
return func(*args, **kwargs)
|
||||||
else:
|
else:
|
||||||
with closing(self.db.cursor()) as cursor:
|
with closing(self.db.cursor()) as cursor:
|
||||||
return func(*[self, cursor], *args[1:], **kwargs)
|
return func(self, cursor, *args[1:], **kwargs)
|
||||||
return wrapped
|
return wrapped
|
||||||
|
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ class PysonicDatabase(object):
|
||||||
artist_info = cursor.execute("SELECT * FROM artists WHERE id = ?", (album["artistid"], )).fetchall()[0]
|
artist_info = cursor.execute("SELECT * FROM artists WHERE id = ?", (album["artistid"], )).fetchall()[0]
|
||||||
|
|
||||||
children = []
|
children = []
|
||||||
for song in cursor.execute("SELECT * FROM songs WHERE albumid = ?", (album["id"], )):
|
for song in cursor.execute("SELECT * FROM songs WHERE albumid = ? ORDER BY track, title ASC;", (album["id"], )):
|
||||||
song["_artist"] = artist_info
|
song["_artist"] = artist_info
|
||||||
children.append(("song", song))
|
children.append(("song", song))
|
||||||
ret[2]['children'] = children
|
ret[2]['children'] = children
|
||||||
|
|
|
@ -6,7 +6,6 @@ lxml==4.2.1
|
||||||
more-itertools==4.1.0
|
more-itertools==4.1.0
|
||||||
mutagen==1.40.0
|
mutagen==1.40.0
|
||||||
portend==2.2
|
portend==2.2
|
||||||
pysonic==0.0.1
|
|
||||||
pytz==2018.3
|
pytz==2018.3
|
||||||
six==1.11.0
|
six==1.11.0
|
||||||
tempora==1.11
|
tempora==1.11
|
||||||
|
|
Loading…
Reference in New Issue