def get_episodes(self, podcast): path = self._get_episode_history_file_path(podcast) if not os.path.exists(path): return [] with open(path, newline='') as f: rows = list(csv.reader(f)) has_header = len(rows) > 0 and rows[0] == Episode.columns if has_header: rows = rows[1:] episodes = reversed([Episode.from_tuple(podcast, e) for e in rows]) return episodes