New property for songs: has_subtitles

This commit is contained in:
Ales (Shagi) Zabala Alava 2022-07-29 12:52:33 +02:00
parent b4fdf6dafb
commit 132ed675e7
1 changed files with 5 additions and 3 deletions

View File

@ -109,11 +109,13 @@ class Song:
self.karaoke_ass = karaoke_ass self.karaoke_ass = karaoke_ass
generate_karaoke_ass(str(karaoke_template_file), str(self.ass), str(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 @property
def publish(self): def publish(self):
has_subtitles = self.ass or self.srt or self.vtt return self.video and self.has_subtitles
has_video = self.video
return has_video and has_subtitles
@property @property
def pending(self): def pending(self):