mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-05 04:53:01 +00:00
sort mixes by created date
+ write og mix date to track mix
This commit is contained in:
+6
-2
@@ -498,9 +498,13 @@ class MixTable(Base):
|
|||||||
@classmethod
|
@classmethod
|
||||||
def get_all(cls, with_userid: bool = False):
|
def get_all(cls, with_userid: bool = False):
|
||||||
if with_userid:
|
if with_userid:
|
||||||
result = cls.execute(select(cls).where(cls.userid == get_current_userid()))
|
result = cls.execute(
|
||||||
|
select(cls)
|
||||||
|
.where(cls.userid == get_current_userid())
|
||||||
|
.order_by(cls.timestamp.desc())
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
result = cls.execute(select(cls))
|
result = cls.execute(select(cls).order_by(cls.timestamp.desc()))
|
||||||
|
|
||||||
return Mix.mixes_to_dataclasses(result.fetchall())
|
return Mix.mixes_to_dataclasses(result.fetchall())
|
||||||
|
|
||||||
|
|||||||
@@ -475,6 +475,7 @@ class MixesPlugin(Plugin):
|
|||||||
"albums": None,
|
"albums": None,
|
||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
trackmix.timestamp = mix.timestamp
|
||||||
|
|
||||||
# INFO: Write track mix save state
|
# INFO: Write track mix save state
|
||||||
if mix.extra.get("trackmix_saved"):
|
if mix.extra.get("trackmix_saved"):
|
||||||
|
|||||||
Reference in New Issue
Block a user