Skip to content

Commit

Permalink
Merge remote-tracking branch 'mpg123/master' into master-with-github-ci
Browse files Browse the repository at this point in the history
  • Loading branch information
mpg123 GitHub bot committed Dec 3, 2024
2 parents 542217a + 85d717e commit 2a71a9a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 14 deletions.
5 changes: 5 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
1.32.10
------
- scripts/tag_lyrics.py: fix for python3 (thanks to cclauss,
github PR 16)

1.32.9
------
- libmpg123:
Expand Down
24 changes: 12 additions & 12 deletions scripts/tag_lyrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@
# get workdir from first arg or use current dir
if (len(sys.argv) > 1):
fname = sys.argv[1]
print "fname=" + fname
print("fname=" + fname)
else:
print 'Give me at least a file name to work on, plus the lyrics from stdin'
print 'Optionally, you can provide the language (3 lowercase letters) of the lyrics and a description'
print('Give me at least a file name to work on, plus the lyrics from stdin')
print('Optionally, you can provide the language (3 lowercase letters) of the lyrics and a description')
sys.exit()

if (len(sys.argv) > 2):
Expand All @@ -32,7 +32,7 @@
if (len(sys.argv) > 3):
TEXT_DESC = sys.argv[3]

print "reading lyrics from standard input ..."
print("reading lyrics from standard input ...")

lyrics = sys.stdin.read().strip()

Expand All @@ -41,25 +41,25 @@
try:
lyrics = lyrics.decode(enc)
TEXT_DESC = TEXT_DESC.decode(enc)
print enc,
print(enc, end=" ")
break
except:
pass

print "Adding lyrics to " + fname
print "Language: " + TEXT_LANG
print "Description: " + TEXT_DESC
print("Adding lyrics to " + fname)
print("Language: " + TEXT_LANG)
print("Description: " + TEXT_DESC)

# create ID3 tag if not exists
try:
tags = ID3(fname)
except ID3NoHeaderError:
print "Adding ID3 header;",
print("Adding ID3 header;", end=" ")
tags = ID3()

# remove old unsychronized lyrics
if len(tags.getall(u"USLT::'"+TEXT_LANG+"'")) != 0:
print "Removing Lyrics."
print("Removing Lyrics.")
tags.delall(u"USLT::'"+TEXT_LANG+"'")
#tags.save(fname) # hm, why?

Expand All @@ -68,9 +68,9 @@
# USLT frames are present
#tags[u"USLT::'eng'"] = (USLT(encoding=3, lang=u'eng', desc=u'desc', text=lyrics))
tags[u"USLT::'"+TEXT_LANG+"'"] = (USLT(encoding=3, lang=TEXT_LANG, desc=TEXT_DESC, text=lyrics))
print 'Added USLT frame to', fname
print('Added USLT frame to', fname)

tags.save(fname)

print 'Done'
print('Done')

4 changes: 2 additions & 2 deletions src/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@
// only single spaces as separator to ease parsing by build scripts
#define MPG123_MAJOR 1
#define MPG123_MINOR 32
#define MPG123_PATCH 9
#define MPG123_PATCH 10
// Don't get too wild with that to avoid confusing m4. No brackets.
// Also, it should fit well into a sane file name for the tarball.
#define MPG123_SUFFIX ""
#define MPG123_SUFFIX "-dev"

#define MPG123_VERSION_CAT_REALLY(a, b, c) #a "." #b "." #c
#define MPG123_VERSION_CAT(a, b, c) MPG123_VERSION_CAT_REALLY(a, b, c)
Expand Down

0 comments on commit 2a71a9a

Please sign in to comment.