• R/O
  • SSH

Commit

Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#objective-cqt誰得cocoawindowspythonrubyphpgameguibathyscaphec翻訳omegat計画中(planning stage)frameworktwittertestdombtronvb.netdirectxarduinopreviewerゲームエンジン

Commit MetaInfo

Revision36b4b5e1e9a06d0d46668a7bcc04d78a84349878 (tree)
Time2019-11-01 19:25:45
AuthorJaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fast...>
CommiterJaime Marquínez Ferrándiz

Log Message

Fix some PEP 8 issues

Change Summary

Incremental Difference

diff -r fa5c6134b523 -r 36b4b5e1e9a0 beetsplug/playersync.py
--- a/beetsplug/playersync.py Thu Aug 29 21:50:30 2019 +0200
+++ b/beetsplug/playersync.py Fri Nov 01 11:25:45 2019 +0100
@@ -16,7 +16,7 @@
1616 from beets.library import parse_query_parts, Item
1717 from beetsplug.convert import get_format, ConvertPlugin
1818
19-_CREATE_DATABASE_SCRIPT='''
19+_CREATE_DATABASE_SCRIPT = '''
2020 CREATE TABLE song(idSong INTEGER PRIMARY KEY, filename TEXT NOT NULL, date TIMESTAMP, synced BOOL);
2121 CREATE TABLE query(idQuery INTEGER PRIMARY KEY AUTOINCREMENT, query TEXT NOT NULL);
2222 CREATE TABLE querysong(idQuery INT REFERENCES query, idSong INT REFERENCES song,
@@ -27,18 +27,21 @@
2727 PRIMARY KEY (idPlaylist, idSong, listIndex));
2828 '''
2929
30+
3031 def _ext_from_format(format):
3132 if format == 'aac':
3233 return 'm4a'
3334 else:
3435 return format
3536
37+
3638 def _format_from_ext(ext):
3739 if ext == 'm4a':
3840 return 'aac'
3941 else:
4042 return ext
4143
44+
4245 class PlayerSync(BeetsPlugin):
4346 def info(self, *args, **kwargs):
4447 return self._log.info(*args, **kwargs)
@@ -138,7 +141,8 @@
138141 self.info('Converting to {0}: {1}', fmt, item)
139142 convert_command, _ = get_format(fmt)
140143 self.config['quiet'] = False
141- ConvertPlugin.encode(self, convert_command, item['path'],
144+ ConvertPlugin.encode(
145+ self, convert_command, item['path'],
142146 copy_path.encode() if (IS_PY3 and isinstance(copy_path, str)) else copy_path)
143147 db.execute('UPDATE song SET synced=1,date=? WHERE idSong=?', (datetime.datetime.now(), item_id))
144148