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
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):
self.reset_uploads_playlist_id()
@ -270,7 +270,7 @@ class Channel(ObjectBase):
@worms.transaction
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):
raise TypeError(f'Playlist id must be a string, not {type(playlist_id)}.')

View file

@ -186,7 +186,7 @@ class YCDLDBVideoMixin:
raise TypeError(video)
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
try:
@ -331,10 +331,10 @@ class YCDLDBVideoMixin:
}
if existing:
log.loud('Updating Video %s.', video.id)
log.loud('Updating Video %s.', video)
self.update(table='videos', pairs=data, where_key='id')
else:
log.loud('Inserting Video %s.', video.id)
log.loud('Inserting Video %s.', video)
self.insert(table='videos', data=data)
# Override the cached copy with the new copy so that the cache contains