def list(self, fields, page_size, page_number): sorting = VideoSorting(fields) return to_table( self.api.list(fields, page_size, page_number), Video, ["video_id"] + sorting.fields + ["filename"], )
def find_batch(self, path): batch_results = self.api.find_batch(path) lines = [] for sentence, found in batch_results: lines.append(sentence) lines.append( to_table(found, Video, ( "", "date", "video_id", "size", "filename")) if found else "\t(nothing)") return to_column(lines)
def same_sizes(self): duplicated_sizes = self.api.same_sizes() lines = [] for size, elements in duplicated_sizes.items(): table = to_table(elements, Video, ("size", "video_id", "filename")) table.append( "", "", "playlist %s" % (" ".join(str(video.video_id) for video in elements)), ) lines.append(table) lines.append("") return to_column(lines)
def unreadable(self): return to_table(self.api.unreadable(), Video, ("video_id", "size", "filename"))
def not_found_from_folder(self, folder): return to_table(self.api.not_found_from_folder(folder), Video, ("video_id", "filename"))
def not_found(self): return to_table(self.api.not_found(), Video, ("video_id", "filename"))
def missing_thumbnails(self): return to_table(self.api.missing_thumbnails(), Video, ("video_id", "size", "filename"))
def find(self, terms): return to_table(self.api.find(terms), Video, ("date", "video_id", "size", "filename"))