def update_bookmark(self, item_id, bookmark_id, name=None, seek_pos=None): item, bookmark = self.__queue.get_bookmark(item_id, bookmark_id) if item is None: self.__log.warning('No such item id (%s)', item_id) return False if bookmark_id is not None and bookmark is None: self.__log.warning('No such bookmark id (%s)', bookmark_id) return False if bookmark_id is None: if name and item.title != name: item.title = name self.__queue.modified = True if self.__queue.current_item == item: self.notify('new-metadata-available', caller=self.update_bookmark) else: bookmark.timestamp = time.time() if name is not None: bookmark.bookmark_name = name if seek_pos is not None: bookmark.seek_position = seek_pos db.update_bookmark(bookmark) return True
def update_bookmark(self, item_id, bookmark_id, name=None, seek_pos=None): item, bookmark = self.__queue.get_bookmark(item_id, bookmark_id) if item is None: self.__log.warning('No such item id (%s)', item_id) return False if bookmark_id is not None and bookmark is None: self.__log.warning('No such bookmark id (%s)', bookmark_id) return False if bookmark_id is None: if name and item.title != name: item.title = name self.__queue.modified = True if self.__queue.current_item == item: self.notify( 'new-metadata-available', caller=self.update_bookmark ) else: bookmark.timestamp = time.time() if name is not None: bookmark.bookmark_name = name if seek_pos is not None: bookmark.seek_position = seek_pos db.update_bookmark(bookmark) return True
def update_bookmarks(self): for bookmark in self.bookmarks: bookmark.playlist_duplicate_id = self.duplicate_id bookmark.bookmark_filepath = self.filepath db.update_bookmark(bookmark)