Skip to content

Commit

Permalink
Always update hidden state
Browse files Browse the repository at this point in the history
  • Loading branch information
mervick committed Dec 24, 2024
1 parent b3840cb commit c78f3b8
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions TelegramSource.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,29 +372,23 @@ def hide_action(self):
entries = self.get_entry_view().get_selected_entries()
if len(entries) == 0:
return
commit = False
for entry in entries:
audio = self.plugin.storage.get_entry_audio(entry)
if not audio.is_hidden:
audio.save({"is_hidden": True})
set_entry_state(self.db, entry, audio.get_state())
commit = True
if commit:
self.db.commit()
set_entry_state(self.db, entry, audio.get_state())
self.db.commit()

def unhide_action(self):
entries = self.get_entry_view().get_selected_entries()
if len(entries) == 0:
return
commit = False
for entry in entries:
audio = self.plugin.storage.get_entry_audio(entry)
if audio.is_hidden:
audio.save({"is_hidden": False})
set_entry_state(self.db, entry, audio.get_state())
commit = True
if commit:
self.db.commit()
set_entry_state(self.db, entry, audio.get_state())
self.db.commit()


GObject.type_register(TelegramSource)

0 comments on commit c78f3b8

Please sign in to comment.