def get_all_tracks(self): tracks=[] for track in gpod.sw_get_playlist_tracks(self.podcasts_playlist): filename=gpod.itdb_filename_on_ipod(track) length=util.calculate_size(filename) age_in_days=util.file_age_in_days(filename) modified=util.file_age_to_string(age_in_days) released=gpod.itdb_time_mac_to_host(track.time_released) released=util.format_date(released) t=SyncTrack(track.title, length, modified, libgpodtrack=track, playcount=track.playcount, released=released, podcast=track.artist) tracks.append(t) return tracks
def get_all_tracks(self): tracks=[] if gl.config.fssync_channel_subfolders: files=glob.glob(os.path.join(self.destination, '*', '*')) else: files=glob.glob(os.path.join(self.destination, '*')) for filename in files: (title, extension)=os.path.splitext(os.path.basename(filename)) length=util.calculate_size(filename) age_in_days=util.file_age_in_days(filename) modified=util.file_age_to_string(age_in_days) if gl.config.fssync_channel_subfolders: podcast_name=os.path.basename(os.path.dirname(filename)) else: podcast_name=None t=SyncTrack(title, length, modified, filename=filename, podcast=podcast_name) tracks.append(t) return tracks
def get_age_string(self): return util.file_age_to_string(self.age_in_days())