Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dylanljones committed Dec 14, 2023
1 parent 1e1be38 commit fbda9d1
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pyrekordbox/db6/database.py
Original file line number Diff line number Diff line change
Expand Up @@ -1991,7 +1991,7 @@ def to_dict(self, verbose=False):
a list of dicts.
"""
data = dict()
for table_name in tables.__all__:
for table_name in tables.TABLES:
if table_name.startswith("Stats") or table_name == "Base":
continue
if verbose:
Expand Down
42 changes: 42 additions & 0 deletions pyrekordbox/db6/tables.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
from .registry import RekordboxAgentRegistry

__all__ = [
"TABLES",
"PlaylistType",
"StatsTime",
"StatsFull",
Expand Down Expand Up @@ -60,6 +61,47 @@
]


TABLES = [
"AgentRegistry",
"CloudAgentRegistry",
"ContentActiveCensor",
"ContentCue",
"ContentFile",
"DjmdActiveCensor",
"DjmdAlbum",
"DjmdArtist",
"DjmdCategory",
"DjmdColor",
"DjmdContent",
"DjmdCue",
"DjmdDevice",
"DjmdGenre",
"DjmdHistory",
"DjmdHotCueBanklist",
"DjmdKey",
"DjmdLabel",
"DjmdMenuItems",
"DjmdMixerParam",
"DjmdMyTag",
"DjmdPlaylist",
"DjmdProperty",
"DjmdRelatedTracks",
"DjmdSampler",
"DjmdSongHistory",
"DjmdSongHotCueBanklist",
"DjmdSongMyTag",
"DjmdSongPlaylist",
"DjmdSongRelatedTracks",
"DjmdSongSampler",
"DjmdSongTagList",
"DjmdSort",
"HotCueBanklistCue",
"ImageFile",
"SettingFile",
"UuidIDMap",
]


class DateTime(TypeDecorator):
"""Custom datetime column with timezone support.
Expand Down
4 changes: 1 addition & 3 deletions tests/test_db6.py
Original file line number Diff line number Diff line change
Expand Up @@ -1101,9 +1101,7 @@ def test_copy_unlocked():

db2 = Rekordbox6Database(UNLOCKED_OUT, unlock=False)
# Check everything got copied
for name in tables.__all__:
if name.startswith("Stats") or name == "Base":
continue
for name in tables.TABLES:
table = getattr(tables, name)
for row in db.query(table):
data = row.to_dict()
Expand Down

0 comments on commit fbda9d1

Please sign in to comment.