mirror of
https://github.com/Dvorinka/swingmusic-extended.git
synced 2026-06-03 20:13:02 +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
|
||||
def get_all(cls, with_userid: bool = False):
|
||||
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:
|
||||
result = cls.execute(select(cls))
|
||||
result = cls.execute(select(cls).order_by(cls.timestamp.desc()))
|
||||
|
||||
return Mix.mixes_to_dataclasses(result.fetchall())
|
||||
|
||||
|
||||
@@ -475,6 +475,7 @@ class MixesPlugin(Plugin):
|
||||
"albums": None,
|
||||
},
|
||||
)
|
||||
trackmix.timestamp = mix.timestamp
|
||||
|
||||
# INFO: Write track mix save state
|
||||
if mix.extra.get("trackmix_saved"):
|
||||
|
||||
Reference in New Issue
Block a user