Exemplo n.º 1
0
 def parse_media(self):
     self.mtime_end = os.path.getmtime(self.file_path)
     if myutil.match_type(self.file_path, ["jpg"]):
         self.media_type = "Image"
     elif myutil.match_type(self.file_path, ["mp4", "mts", "lrv"]):
         self.media_type = "Video"
     elif myutil.match_type(self.file_path, ["wav"]):
         self.media_type = "Audio"
     media_info = MediaInfo.parse(self.file_path)
     for track in media_info.tracks:
         if StreamFile.Debug:
             pprint(track.to_data())
         if track.track_type == "Video":  # some jpg has a video track
             self.video_width = track.width
             self.video_height = track.height
             if track.duration is None:
                 self.duration = -1
             else:
                 self.duration = track.duration
             break
         elif track.track_type == "Audio":
             self.duration = track.duration
             break
         elif track.track_type == "Image":
             self.video_width = track.width
             self.video_height = track.height
             self.duration = -1
             break
     self.calc_mtime_begin()
Exemplo n.º 2
0
 def parse_media(self):
     self.mtime_end = os.path.getmtime(self.file_path)
     if myutil.match_type(self.file_path, ["jpg"]):
         self.media_type = "Image"
     elif myutil.match_type(self.file_path, ["mp4", "mts", "lrv"]):
         self.media_type = "Video"
     elif myutil.match_type(self.file_path, ["wav"]):
         self.media_type = "Audio"
     media_info = MediaInfo.parse(self.file_path)
     for track in media_info.tracks:
         if StreamFile.Debug:
             pprint(track.to_data())
         if track.track_type == "Video":     # some jpg has a video track
             self.video_width = track.width
             self.video_height = track.height
             if track.duration is None:
                 self.duration = -1
             else:
                 self.duration = track.duration
             break
         elif track.track_type == "Audio":
             self.duration = track.duration
             break
         elif track.track_type == "Image":
             self.video_width = track.width
             self.video_height = track.height
             self.duration = -1
             break
     self.calc_mtime_begin()
Exemplo n.º 3
0
def not_interested_path(root, path):
    # returns true for paths that we do not care
    if myutil.rel_level(root, path) < MIN_PATH_CHECK_LEVEL:
        return True
    if myutil.is_hidden(path):
        return True
    if myutil.contain_hidden_dir(path):
        return True
    if not myutil.match_type(path, ["mp4", "jpg", "wav", "mts", "lrv"]):
        return True
    return False
Exemplo n.º 4
0
def not_interested_path(root, path):
    # returns true for paths that we do not care
    if myutil.rel_level(root, path) < MIN_PATH_CHECK_LEVEL:
        return True
    if myutil.is_hidden(path):
        return True
    if myutil.contain_hidden_dir(path):
        return True
        # if not myutil.match_type(path, ["mp4", "jpg", "wav", "mts", "lrv"]):
    if not myutil.match_type(path, ["mp4", "wav", "mts", "lrv"]): # fixme
        return True
    return False