Пример #1
0
 def set_file_id(self, id):
     file = Query.get_file(id)
     try:
         # self.imgfile = f'/media/soni/1001/persistent/1001/thumbs/{file.id}.jpg'
         self.imgfile = IMGPATH.format(file.id)
     except Exception as e:
         pass
     self.id = file.id
     self.filename = file.filename
     self.filepath = file.filepath
     self.size = format_size(file.size)
     self.mtime = str(file.mtime)
     self.thumbpath = file.thumb if file.thumb != None else ""
     self.set = file.set if file.set != None else ""
     self.note = file.note if file.note != None else ""
     self.rating = file.rating
     #
     for q in Query.file_tags(id):
         self.tags_container.add_tagchild(q[0],q[1])
     for q in Query.tag_findall(file.filename):
         self.rcmmnds_container.add_sggstchild(q)
Пример #2
0
 def on_rethumb_button_clicked(self,widget):
     img = widget.get_image()
     item = Query.get_file(self.id)
     dest = rethumb(item, 'archives')
     img.set_from_file(dest)