quote names to color them in console output
MODIFY
plextraktsync/sync.py
plextraktsync/sync.py
@@ -219,8 +219,8 @@ def sync_watched(self, m: Media, dry_run=False):
if m.is_episode and m.watched_before_reset:
show = m.plex.item.show()
- logger.info(f"Show {show.title} has been reset in trakt at {m.show_reset_at}.")
- logger.info(f"Marking {show.title} as unwatched in Plex.")
+ logger.info(f"Show '{show.title}' has been reset in trakt at {m.show_reset_at}.")
+ logger.info(f"Marking '{show.title}' as unwatched in Plex.")
if not dry_run:
m.reset_show()
else:
@@ -242,19 +242,19 @@ def watchlist_sync_item(self, m: Media, dry_run=False):
trakt_wl = self.trakt_wl_shows
if m.plex is None:
if self.config.update_plex_wl:
- logger.info(f"Skipping {m.trakt.title} from Trakt watchlist because not found in Plex Discover")
+ logger.info(f"Skipping '{m.trakt.title}' from Trakt watchlist because not found in Plex Discover")
elif self.config.update_trakt_wl:
- logger.info(f"Removing {m.trakt.title} from Trakt watchlist")
+ logger.info(f"Removing '{m.trakt.title}' from Trakt watchlist")
if not dry_run:
m.remove_from_trakt_watchlist(batch=True)
elif m.plex.item.guid in self.plex_wl:
if m.trakt.trakt not in trakt_wl:
if self.config.update_trakt_wl:
- logger.info(f"Adding {m.plex.item.title} to Trakt watchlist")
+ logger.info(f"Adding '{m.plex.item.title}' to Trakt watchlist")
if not dry_run:
m.add_to_trakt_watchlist(batch=True)
else:
- logger.info(f"Removing {m.trakt.title} from Plex watchlist")
+ logger.info(f"Removing '{m.trakt.title}' from Plex watchlist")
if not dry_run:
m.remove_from_plex_watchlist()
else:
@@ -262,11 +262,11 @@ def watchlist_sync_item(self, m: Media, dry_run=False):
else:
if m.trakt.trakt in trakt_wl:
if self.config.update_plex_wl:
- logger.info(f"Adding {m.trakt.title} to Plex watchlist")
+ logger.info(f"Adding '{m.trakt.title}' to Plex watchlist")
if not dry_run:
m.add_to_plex_watchlist()
else:
- logger.info(f"Removing {m.trakt.title} from Trakt watchlist")
+ logger.info(f"Removing '{m.trakt.title}' from Trakt watchlist")
if not dry_run:
m.remove_from_trakt_watchlist(batch=True)

MODIFY
plextraktsync/trakt_api.py
plextraktsync/trakt_api.py
@@ -554,7 +554,7 @@ def from_number(self, season, number):
def from_id(self, provider, id):
# NB: the code assumes from_id is called only if from_number fails
if self.same_order:
- logger.warning(f'"{self.tm.title}" {EPISODES_ORDERING_WARNING}')
+ logger.warning(f"'{self.tm.title}' {EPISODES_ORDERING_WARNING}")
self.same_order = False
if provider not in self.provider_table:
self._reverse_lookup(provider)

MODIFY
plextraktsync/trakt_list_util.py
plextraktsync/trakt_list_util.py
@@ -76,10 +76,10 @@ def addPlexItem(self, trakt_item, plex_item):
self.plex_items.append((rank, plex_item))
if isinstance(plex_item, Episode):
logger.info(
- f"Added to list {self.name}: {plex_item.show()}: {plex_item.seasonEpisode}"
+ f"Added to list '{self.name}': {plex_item.show()}: {plex_item.seasonEpisode}"
)
else:
- logger.info(f"Added to list {self.name}: {plex_item}")
+ logger.info(f"Added to list '{self.name}': {plex_item}")
class TraktListUtil:
@@ -91,14 +91,14 @@ def __init__(self):
def addList(self, listid, listname, trakt_list=None):
if trakt_list is not None:
self.lists.append(TraktList.from_trakt_list(listname, trakt_list))
- logger.info(f"Created {listname} from {len(trakt_list)} items")
+ logger.info(f"Created list '{listname}' from {len(trakt_list)} items")
return
try:
self.lists.append(TraktList(listid, listname))
- logger.info(f"Downloaded List: {listname}")
+ logger.info(f"Downloaded list '{listname}'")
except (NotFoundException, OAuthException):
logger.warning(
- f"Failed to get list {listname} with id {listid}"
+ f"Failed to get list '{listname}' with id {listid}"
)
def addPlexItemToLists(self, m):

quote names to color them in console output (#1193)