Log these objects using their str instead of .id.

This commit is contained in:
voussoir 2021-10-25 14:02:21 -07:00
parent 8821491ff3
commit 6370e36c84
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB
2 changed files with 5 additions and 5 deletions

View file

@ -151,7 +151,7 @@ class Channel(ObjectBase):
@worms.transaction @worms.transaction
def refresh(self, *, force=False, rss_assisted=True): def refresh(self, *, force=False, rss_assisted=True):
log.info('Refreshing %s.', self.id) log.info('Refreshing %s.', self)
if force or (not self.uploads_playlist): if force or (not self.uploads_playlist):
self.reset_uploads_playlist_id() self.reset_uploads_playlist_id()
@ -270,7 +270,7 @@ class Channel(ObjectBase):
@worms.transaction @worms.transaction
def set_uploads_playlist_id(self, playlist_id): def set_uploads_playlist_id(self, playlist_id):
log.debug('Setting %s upload playlist to %s.', self.id, playlist_id) log.debug('Setting %s upload playlist to %s.', self, playlist_id)
if not isinstance(playlist_id, str): if not isinstance(playlist_id, str):
raise TypeError(f'Playlist id must be a string, not {type(playlist_id)}.') raise TypeError(f'Playlist id must be a string, not {type(playlist_id)}.')

View file

@ -186,7 +186,7 @@ class YCDLDBVideoMixin:
raise TypeError(video) raise TypeError(video)
if video.state != 'pending' and not force: if video.state != 'pending' and not force:
log.debug('%s does not need to be downloaded.', video.id) log.debug('%s does not need to be downloaded.', video)
return return
try: try:
@ -331,10 +331,10 @@ class YCDLDBVideoMixin:
} }
if existing: if existing:
log.loud('Updating Video %s.', video.id) log.loud('Updating Video %s.', video)
self.update(table='videos', pairs=data, where_key='id') self.update(table='videos', pairs=data, where_key='id')
else: else:
log.loud('Inserting Video %s.', video.id) log.loud('Inserting Video %s.', video)
self.insert(table='videos', data=data) self.insert(table='videos', data=data)
# Override the cached copy with the new copy so that the cache contains # Override the cached copy with the new copy so that the cache contains