Skip to content

Commit

Permalink
Clean up debug code
Browse files Browse the repository at this point in the history
  • Loading branch information
jsedge committed Jan 6, 2019
1 parent 4d858bd commit 5d51c2c
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
1 change: 0 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ exclude =
.idea,
pyside-setup,
ene/lib,
ene/bin,
/**/__init__.py,
ene/constants.py,
ene/resources,
Expand Down
12 changes: 8 additions & 4 deletions ene/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def refresh_single_show(self, show):
res = []
for directory in self.dirs:
res.extend(self.find_episodes(show, directory))
new = set(res) - self.series[show].episodes
new = set(res) - self.series.get_episodes(show)
for new_show in new:
self.series[show].add_episode(new_show)
return sorted(new)
Expand Down Expand Up @@ -150,7 +150,7 @@ def get_readable_names(self, show: str) -> Iterable[str]:
Yields:
The file names in the show
"""
for path in self.series[show].episodes:
for path in self.series.get_episodes(show):
yield path.name

def rename_show(self, old, new):
Expand All @@ -167,7 +167,12 @@ def rename_show(self, old, new):
The episode list for the new show
"""
if new in self.series:
self.series[new].episodes.union(self.series[old].episodes)
for episode in self.series.get_episodes(old):
self.series[new].add_episode(episode)
episode.model.show = self.series[new].model
episode.model.save()
self.series[old].model.delete_instance()
self.series.pop(old)
else:
self.series[old].model.title = new
self.series[old].title = new
Expand All @@ -183,7 +188,6 @@ def delete_show(self, show):
show:
The show to remove
"""
print(self.series[show].title)
self.series[show].model.delete_instance()
self.series.pop(show)

Expand Down
1 change: 0 additions & 1 deletion ene/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ def init_db(path):
# need to use global DB so that we can specify the database location at runtime
global db
db.init(path)
print(path)
db.connect()
db.create_tables([Show.ShowModel, Episode.EpisodeModel])

Expand Down
3 changes: 1 addition & 2 deletions ene/ui/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ def refresh_library(self):
button = SeriesButton(show, len(self.files.series[show]))
button.clicked.connect(self.on_series_click)
self.page_widget.layout().addWidget(button)
# TODO: Put this back in

self.files.dump_to_db()

def rename_show(self):
Expand Down Expand Up @@ -317,7 +317,6 @@ def search_shows(self):
Hides all shows that do not match the search criteria
"""
search_text = self.search.findChild(QLineEdit).text().lower()
print(search_text)
# TODO: Make this not break the FlowLayout
for show in self.page_widget.findChildren(SeriesButton):
if search_text not in show.title.lower():
Expand Down

0 comments on commit 5d51c2c

Please sign in to comment.