1
0
mirror of https://github.com/283375/arcaea-offline.git synced 2025-04-14 12:00:19 +00:00

feat(db): get_songs_by_pack_id

This commit is contained in:
283375 2023-09-17 00:27:20 +08:00
parent 589826004b
commit c909886902
Signed by: 283375
SSH Key Fingerprint: SHA256:UcX0qg6ZOSDOeieKPGokA5h7soykG61nz2uxuQgVLSk

@ -130,6 +130,12 @@ class Database(metaclass=Singleton):
results = list(session.scalars(stmt))
return results
def get_songs_by_pack_id(self, pack_id: str):
stmt = select(Song).where(Song.set == pack_id)
with self.sessionmaker() as session:
results = list(session.scalars(stmt))
return results
def get_song(self, song_id: str):
stmt = select(Song).where(Song.id == song_id)
with self.sessionmaker() as session: