Skip to content

Commit

Permalink
Update series SQL model
Browse files Browse the repository at this point in the history
- Use dictionaries instead of lists for season titles and extras
- Remove image source priority column
- Use None as default episode text format
- #311
  • Loading branch information
CollinHeist committed Mar 21, 2023
1 parent 9a46eb6 commit bae1733
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/models/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from json import dumps, loads
from sqlalchemy import Boolean, Column, ForeignKey, Integer, String
from sqlalchemy.ext.hybrid import hybrid_property, hybrid_method
from sqlalchemy.ext.mutable import MutableList
from sqlalchemy.ext.mutable import MutableDict, MutableList
from sqlalchemy import PickleType

from app.database.session import Base
Expand All @@ -30,7 +30,7 @@ class Series(Base):
plex_library_name = Column(String, default=None)
filename_format = Column(String, default='{full_name} - S{season:02}E{episode:02}')
episode_data_source = Column(String, default='Sonarr')
image_source_priority = Column(MutableList.as_mutable(PickleType), default=['TMDb', 'Plex', 'Emby'])
# image_source_priority = Column(MutableList.as_mutable(PickleType), default=['TMDb', 'Plex', 'Emby'])
sync_specials = Column(Boolean, default=False)
skip_localized_images = Column(Boolean, default=False)
translations = Column(MutableList.as_mutable(PickleType), default=[])
Expand All @@ -51,12 +51,12 @@ class Series(Base):
directory = Column(String, default=default_directory)
card_type = Column(String, default='standard')
hide_seasons = Column(Boolean, default=False)
season_titles = Column(MutableList.as_mutable(PickleType), default=[])
season_titles = Column(MutableDict.as_mutable(PickleType), default={})
hide_episode_text = Column(Boolean, default=False)
episode_text_format = Column(String, default='Episode {episode_number}')
episode_text_format = Column(String, default=None)
unwatched_style = Column(String, default='unique')
watched_style = Column(String, default='unique')
extras = Column(MutableList.as_mutable(PickleType), default=[])
extras = Column(MutableDict.as_mutable(PickleType), default={})

@hybrid_property
def full_name(self) -> str:
Expand Down

0 comments on commit bae1733

Please sign in to comment.