Skip to content
This repository has been archived by the owner on Dec 10, 2019. It is now read-only.

Commit

Permalink
Fix #68: Require Mopidy v1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
tkem committed Sep 4, 2015
1 parent ce2bd4c commit 47089a4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
19 changes: 3 additions & 16 deletions mopidy_local_sqlite/__init__.py
Expand Up @@ -40,22 +40,9 @@ def setup(self, registry):

@classmethod
def get_or_create_data_dir(cls, config):
if hasattr(cls, 'get_data_dir'):
# Mopidy >= 1.1
data_dir = cls().get_data_dir(config)
migrate_old_data_dir(config, data_dir)
return data_dir
# Mopidy < 1.1
try:
data_dir = config['local']['data_dir']
except KeyError:
from mopidy.exceptions import ExtensionError
raise ExtensionError('Mopidy-Local not enabled')
path = os.path.join(data_dir, b'sqlite')
if not os.path.isdir(path):
logger.info('Creating directory %s', path)
os.makedirs(path, 0o755)
return path
data_dir = cls().get_data_dir(config)
migrate_old_data_dir(config, data_dir)
return data_dir


def migrate_old_data_dir(config, new_dir):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Expand Up @@ -25,7 +25,7 @@ def get_version(filename):
include_package_data=True,
install_requires=[
'setuptools',
'Mopidy >= 1.0',
'Mopidy >= 1.1',
'Pykka >= 1.1',
'uritools >= 1.0'
],
Expand Down

0 comments on commit 47089a4

Please sign in to comment.