Skip to content

Commit

Permalink
Bumped the version number.
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisnorman7 committed Oct 16, 2016
1 parent 2aba431 commit e6642f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 3 additions & 1 deletion application.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@
import wx

name = 'GMP3'
__version__ = '3.1'
__version__ = '4.0.0'
url = 'https://github.com/chrisnorman7/gmp3'


app = wx.App(False)
app.SetAppName(name)
Expand Down
21 changes: 11 additions & 10 deletions functions/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,17 @@ def load_station(station):
def clean_library():
"""Remove unwanted files and directories from the media directory."""
dir = config.storage['media_dir']
tracks = ['%s.mp3' % t.id for t in db.session.query(db.Track).all()]
for thing in os.listdir(dir):
path = os.path.join(dir, thing)
if os.path.isdir(path):
logger.info('Removing directory %s.', path)
os.removedirs(path)
else:
if thing not in tracks:
logger.info('Removing file %s.', path)
os.remove(path)
if os.path.isdir(dir):
tracks = ['%s.mp3' % t.id for t in db.session.query(db.Track).all()]
for thing in os.listdir(dir):
path = os.path.join(dir, thing)
if os.path.isdir(path):
logger.info('Removing directory %s.', path)
os.removedirs(path)
else:
if thing not in tracks:
logger.info('Removing file %s.', path)
os.remove(path)

def prune_library():
"""Delete the least recently downloaded tracks in the catalogue."""
Expand Down

0 comments on commit e6642f2

Please sign in to comment.