Skip to content

Commit

Permalink
fix number formats within brackets
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Horowitz authored and bebarino committed Sep 21, 2009
1 parent 2cc1a27 commit 0197910
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -10,6 +10,7 @@ v1.5.1 - Pending
+ Bug: Songs not tagged with the album name don't show off
+ Bug: Can not disconnect when MPD_HOST and MPD_PORT are set
+ Bug: Toggle argument doesn't work
+ Bug: Fix %D and %N formats within brackets

v1.5 - April 3, 2008
+ Replace album view with genre view for library
Expand Down
8 changes: 5 additions & 3 deletions sonata/main.py
Expand Up @@ -2793,15 +2793,17 @@ def _parse_formatting_substrings(self, subformat, item, wintitle):
else:
return ""
if "%N" in text:
track = mpdh.getnum(item, 'track', flag, False, 2)
track = mpdh.get(item, 'track', flag)
if track != flag:
track = mpdh.getnum(item, 'track', flag, False, 2)
text = text.replace("%N", track)
else:
if not has_brackets: text = text.replace("%N", "0")
if not has_brackets: text = text.replace("%N", "00")
else: return ""
if "%D" in text:
disc = mpdh.getnum(item, 'disc', flag, False, 0)
disc = mpdh.get(item, 'disc', flag)
if disc != flag:
disc = mpdh.getnum(item, 'disc', flag, False, 0)
text = text.replace("%D", disc)
else:
if not has_brackets: text = text.replace("%D", "0")
Expand Down

0 comments on commit 0197910

Please sign in to comment.