Revisión | 36b4b5e1e9a06d0d46668a7bcc04d78a84349878 (tree) |
---|---|
Tiempo | 2019-11-01 19:25:45 |
Autor | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fast...> |
Commiter | Jaime Marquínez Ferrándiz |
Fix some PEP 8 issues
@@ -16,7 +16,7 @@ | ||
16 | 16 | from beets.library import parse_query_parts, Item |
17 | 17 | from beetsplug.convert import get_format, ConvertPlugin |
18 | 18 | |
19 | -_CREATE_DATABASE_SCRIPT=''' | |
19 | +_CREATE_DATABASE_SCRIPT = ''' | |
20 | 20 | CREATE TABLE song(idSong INTEGER PRIMARY KEY, filename TEXT NOT NULL, date TIMESTAMP, synced BOOL); |
21 | 21 | CREATE TABLE query(idQuery INTEGER PRIMARY KEY AUTOINCREMENT, query TEXT NOT NULL); |
22 | 22 | CREATE TABLE querysong(idQuery INT REFERENCES query, idSong INT REFERENCES song, |
@@ -27,18 +27,21 @@ | ||
27 | 27 | PRIMARY KEY (idPlaylist, idSong, listIndex)); |
28 | 28 | ''' |
29 | 29 | |
30 | + | |
30 | 31 | def _ext_from_format(format): |
31 | 32 | if format == 'aac': |
32 | 33 | return 'm4a' |
33 | 34 | else: |
34 | 35 | return format |
35 | 36 | |
37 | + | |
36 | 38 | def _format_from_ext(ext): |
37 | 39 | if ext == 'm4a': |
38 | 40 | return 'aac' |
39 | 41 | else: |
40 | 42 | return ext |
41 | 43 | |
44 | + | |
42 | 45 | class PlayerSync(BeetsPlugin): |
43 | 46 | def info(self, *args, **kwargs): |
44 | 47 | return self._log.info(*args, **kwargs) |
@@ -138,7 +141,8 @@ | ||
138 | 141 | self.info('Converting to {0}: {1}', fmt, item) |
139 | 142 | convert_command, _ = get_format(fmt) |
140 | 143 | self.config['quiet'] = False |
141 | - ConvertPlugin.encode(self, convert_command, item['path'], | |
144 | + ConvertPlugin.encode( | |
145 | + self, convert_command, item['path'], | |
142 | 146 | copy_path.encode() if (IS_PY3 and isinstance(copy_path, str)) else copy_path) |
143 | 147 | db.execute('UPDATE song SET synced=1,date=? WHERE idSong=?', (datetime.datetime.now(), item_id)) |
144 | 148 |