Exemplo n.º 1
0
 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"],
     )
Exemplo n.º 2
0
 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)
Exemplo n.º 3
0
 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)
Exemplo n.º 4
0
 def unreadable(self):
     return to_table(self.api.unreadable(), Video,
                     ("video_id", "size", "filename"))
Exemplo n.º 5
0
 def not_found_from_folder(self, folder):
     return to_table(self.api.not_found_from_folder(folder), Video,
                     ("video_id", "filename"))
Exemplo n.º 6
0
 def not_found(self):
     return to_table(self.api.not_found(), Video, ("video_id", "filename"))
Exemplo n.º 7
0
 def missing_thumbnails(self):
     return to_table(self.api.missing_thumbnails(), Video,
                     ("video_id", "size", "filename"))
Exemplo n.º 8
0
 def find(self, terms):
     return to_table(self.api.find(terms), Video,
                     ("date", "video_id", "size", "filename"))