Compare commits
No commits in common. "1dcfce393b4cca9c60a4ccac99f0664dc627f7ac" and "257fcc98fabd4d7d318a08867de9588f11c998c6" have entirely different histories.
1dcfce393b
...
257fcc98fa
|
@ -1,12 +1,5 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## 1.3
|
|
||||||
|
|
||||||
* New property for songs: has_subtitles
|
|
||||||
* Upgrade dependencies
|
|
||||||
* Add songs without ass file as pending
|
|
||||||
* Song folders must have a metadata.json file
|
|
||||||
|
|
||||||
## 1.2
|
## 1.2
|
||||||
|
|
||||||
* Get karaoke ass generator from negromate.web
|
* Get karaoke ass generator from negromate.web
|
||||||
|
@ -16,7 +9,6 @@
|
||||||
* Use configuration file for commands defaults
|
* Use configuration file for commands defaults
|
||||||
|
|
||||||
## 1.1
|
## 1.1
|
||||||
|
|
||||||
* Start with generic negromate command with entry points for other modules
|
* Start with generic negromate command with entry points for other modules
|
||||||
* Move image generating code to utils
|
* Move image generating code to utils
|
||||||
* Migrate setup to pep517
|
* Migrate setup to pep517
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
VERSION = "1.3"
|
VERSION = "1.2"
|
||||||
|
|
||||||
|
|
||||||
logger = logging.getLogger("negromate.songs")
|
logger = logging.getLogger("negromate.songs")
|
||||||
|
|
|
@ -109,18 +109,11 @@ 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):
|
||||||
return self.video and self.has_subtitles
|
has_subtitles = self.ass or self.srt or self.vtt
|
||||||
|
has_video = self.video
|
||||||
@property
|
return has_video and has_subtitles
|
||||||
def pending(self):
|
|
||||||
finished = self.ass and self.video
|
|
||||||
return not finished
|
|
||||||
|
|
||||||
|
|
||||||
def load_songs(root_folder, generate=True, regenerate=False, karaoke_template_file=None):
|
def load_songs(root_folder, generate=True, regenerate=False, karaoke_template_file=None):
|
||||||
|
@ -129,7 +122,7 @@ def load_songs(root_folder, generate=True, regenerate=False, karaoke_template_fi
|
||||||
for entry in root_folder.iterdir():
|
for entry in root_folder.iterdir():
|
||||||
if entry.name in ['static', 'playlist', 'home', 'todo']:
|
if entry.name in ['static', 'playlist', 'home', 'todo']:
|
||||||
continue
|
continue
|
||||||
if entry.is_dir() and (entry / 'metadata.json').exists():
|
if entry.is_dir():
|
||||||
logger.info("building {}".format(entry.name))
|
logger.info("building {}".format(entry.name))
|
||||||
try:
|
try:
|
||||||
song = Song(entry, root_folder)
|
song = Song(entry, root_folder)
|
||||||
|
@ -140,7 +133,7 @@ def load_songs(root_folder, generate=True, regenerate=False, karaoke_template_fi
|
||||||
continue
|
continue
|
||||||
if song.publish:
|
if song.publish:
|
||||||
songs.append(song)
|
songs.append(song)
|
||||||
if song.pending:
|
else:
|
||||||
pending_songs.append(song)
|
pending_songs.append(song)
|
||||||
|
|
||||||
songs.sort(key=lambda a: a.name)
|
songs.sort(key=lambda a: a.name)
|
||||||
|
|
Loading…
Reference in New Issue