Skip to content

Commit

Permalink
try to find performer and title
Browse files Browse the repository at this point in the history
dash containing string without time is good candidate
  • Loading branch information
artur-shaik committed Sep 22, 2023
1 parent 7e7213f commit ec120c3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
18 changes: 16 additions & 2 deletions cuegen.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ def __init__(self) -> None:
pass

def __repr__(self) -> str:
if not self.file and self.performer and self.title:
self.file = (f'{self.performer.lower().replace(" ", "_")}_-_'
f'{self.title.lower().replace(" ", "_")}.'
f'{self.file_ext.lower()}')
return (
f'PERFORMER "{self.performer}"\n'
f'TITLE "{self.title}"\n'
Expand Down Expand Up @@ -107,12 +111,22 @@ def main():
else:
tracklist_data = [line for line in sys.stdin]

print(cue_title)
tracks = []
for line in tracklist_data:
cue_track = CueTrack()
cue_track.parse(line)
if cue_track.is_parsed():
print(cue_track)
tracks.append(cue_track)
elif ' - ' in line:
splitted = line.split(' - ')
if not cue_title.performer:
cue_title.performer = splitted[0].strip()
if not cue_title.title:
cue_title.title = splitted[1].strip()

print(cue_title)
for track in tracks:
print(track)


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup(
name='CueParser',
version='1.1.1',
version='1.1.2',

description='Simple cue file parser.',
long_description=long_description,
Expand Down

0 comments on commit ec120c3

Please sign in to comment.