From 132ed675e77ddc0b520ddfa2c78cd445e0fc0869 Mon Sep 17 00:00:00 2001 From: shagi Date: Fri, 29 Jul 2022 12:52:33 +0200 Subject: [PATCH] New property for songs: has_subtitles --- negromate/songs/loader.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/negromate/songs/loader.py b/negromate/songs/loader.py index 9e05be6..79c3774 100644 --- a/negromate/songs/loader.py +++ b/negromate/songs/loader.py @@ -109,11 +109,13 @@ class Song: self.karaoke_ass = karaoke_ass generate_karaoke_ass(str(karaoke_template_file), str(self.ass), str(karaoke_ass)) + @property + def has_subtitles(self): + return self.ass or self.srt or self.vtt + @property def publish(self): - has_subtitles = self.ass or self.srt or self.vtt - has_video = self.video - return has_video and has_subtitles + return self.video and self.has_subtitles @property def pending(self):