Laurent Monin
1accac01df
Call (new) File.update_item() where appropriate
...
In set_pending()/clear_pending() we don't need a full update.
2019-03-18 13:18:03 +01:00
Laurent Monin
0b64620bcc
Cleanup File state, tracknumber, discnumber properties
...
- use @property and @property.setter decorators
- make those more obvious
- drop force_update / update parameters as they were hiding File.update() calls
- remove redundant File.update() calls
- state property: only emit tagger_stats_changed signal when num_pending_files actually changed
- simplify tests in File.update(), introduced in 62c7056236
2019-03-18 13:18:00 +01:00
Laurent Monin
d4528baa2e
Merge pull request #1132 from zas/os_stat_utime
...
PICARD-1494: Improve file times preservation using os.utime() ns parameter
2019-03-18 13:08:06 +01:00
Laurent Monin
24a5e8dbea
Merge pull request #1133 from zas/cluster_add_file
...
Cluster.add_file(): reduce code redundancy, using add_files([file])
2019-03-18 12:09:17 +01:00
Laurent Monin
812b3ab263
Merge pull request #1138 from zas/collection_cleanup
...
Collection cleanup
2019-03-18 12:08:49 +01:00
Laurent Monin
85b0f7dd50
Merge pull request #1139 from phw/PICARD-1493-fix-config-upgrade-messagebox
...
PICARD-1493: Fixed opening message box during 1.0 config upgrade
2019-03-18 12:07:49 +01:00
Philipp Wolfer
b8c60f7bf9
PICARD-1493: Fixed opening message box during 1.0 config upgrade
...
Using QMessageBox.question with custom buttons is not supported in Qt5. Use custom implementation.
2019-03-18 10:42:50 +01:00
Laurent Monin
637320c8a8
Collection: reduce code redundancy and make it easier to read
...
- Introduce helper function get_user_collection()
- Add a debug output to list found user collections (with id and name)
2019-03-17 23:16:38 +01:00
Laurent Monin
87eaeceafa
Collection: don't be quiet add/remove error
...
Report it on status bar and error log
2019-03-17 22:39:10 +01:00
Laurent Monin
72d6dfb313
Collection: reduce code redundancy
...
Most of the code is shared between add and remove actions
2019-03-17 22:19:35 +01:00
Laurent Monin
04dcd4691b
_script_to_filename(): be consistent, use settings if defined
2019-03-15 17:52:08 +01:00
Laurent Monin
488b0441fb
Add TODO / FIXME
...
This code is messy at best, prolly buggy in fact.
2019-03-15 10:41:29 +01:00
Laurent Monin
7ae49476ef
Use str.starswith()
2019-03-15 10:40:55 +01:00
Laurent Monin
99d646d4f8
Simplify test for non-empty naming_format variable
2019-03-15 10:36:40 +01:00
Laurent Monin
9bf803c8c2
Use intermediate variable win_compat, improve consistency
2019-03-15 10:35:16 +01:00
Laurent Monin
f7011a7bee
Move part of File._make_filename() to new File._format_filename()
2019-03-15 10:33:00 +01:00
Laurent Monin
08a7ce0d28
Fix _make_filename(): use settings instead of config.setting
...
- use passed settings (which defaults to config.setting) as in the rest of the function
- remove reference to nonexistent option 'windows_compatibility_drive_root'
2019-03-15 10:06:59 +01:00
Laurent Monin
6a63c3e5be
Improve file times preservation using os.utime() ns parameter (py >= 3.3)
...
https://docs.python.org/3/library/os.html#os.utime
Since Python 3.3, ns parameter is available
"The best way to preserve exact times is to use the st_atime_ns and st_mtime_ns
fields from the os.stat() result object with the ns parameter to utime."
Make time preservation testable.
2019-03-14 10:57:55 +01:00
Laurent Monin
1ff54bdd83
Cluster.add_file(): reduce code redundancy, using add_files([file])
2019-03-14 10:54:33 +01:00
Laurent Monin
b6dd3dfecd
Merge pull request #1131 from phw/PICARD-1491-fix-plugin-list-version-check
...
PICARD-1491: Fix plugin version check when loading plugin list
2019-03-12 19:16:29 +01:00
Laurent Monin
95f60e5d94
Merge pull request #1129 from phw/PICARD-1490-fix-local-cover-art
...
PICARD-1490: Fix local cover art loading on Windows
2019-03-12 19:14:15 +01:00
Philipp Wolfer
0cdbfdd586
PICARD-1491: Fix plugin version check when loading plugin list
2019-03-12 18:05:53 +01:00
Philipp Wolfer
6ce942f2b1
More NEWS.txt formatting fixes
2019-03-12 16:25:47 +01:00
Philipp Wolfer
bba5cef5fe
PICARD-1490: Run Windows path test on Windows only
2019-03-12 16:18:45 +01:00
Philipp Wolfer
0ce63b9dd6
Format older changelog entries with newer subheading syntax
2019-03-12 15:23:29 +01:00
Philipp Wolfer
e573dccc09
PICARD-1490: Fix local cover art loading on Windows
2019-03-12 09:19:16 +01:00
Laurent Monin
af98bca57d
Merge pull request #1126 from zas/discid_oserror
...
Better handling of missing libdiscid, catching OSError
2019-03-10 18:15:49 +01:00
Laurent Monin
57438669d0
Merge pull request #1127 from zas/fix_move_additionnal_files
...
_move_additional_files(): return asap if same directory
2019-03-10 18:12:38 +01:00
Laurent Monin
5f6ee77b15
Ignore upload failures during osx packaging
...
It causes Travis CI checks to fail far too often
2019-03-10 15:36:32 +00:00
Laurent Monin
7e2369c1f3
_move_additional_files(): return asap if same directory
...
If old file and new file are in the same directory, there's no need to move any additionnal files
Apparently, the code wasn't really taking care of this,
since its introduction in 6d4dc078ae
2019-03-09 16:34:05 +01:00
Laurent Monin
38a048f8dc
Clean up /reformat install doc (especially regarding discid/libdiscid)
2019-03-09 11:40:41 +01:00
Laurent Monin
326f29b268
Better handling of missing libdiscid, catching OSError as per documentation
...
Picard cannot run without this patch and missing libdiscid and python-libdiscid.
It falls back on discid module, but when this one is trying to load libdiscid it fails with:
OSError: libdiscid.so.0: cannot open shared object file: No such file or directory
According to https://python-discid.readthedocs.io/en/latest/install/#dependencies
"The module discid cannot be imported without Libdiscid >= 0.2.2 installed.
If you want to use it as optional dependency, import the module only when
needed or catch the OSError when libdiscid is not found."
So catch OSError and define discid to None.
After that, Picard runs but emits a warning:
W: 10:54:37,425 picard/ui/mainwindow.create_actions:465: CDROM: discid library not found - Lookup CD functionality disabled
2019-03-09 11:07:31 +01:00
Laurent Monin
4ba06e854b
Minor PEP8 fixes
2019-03-08 11:20:26 +01:00
Laurent Monin
f90718a2a2
Merge pull request #1125 from phw/PICARD-1485-format-time-with-hours
...
PICARD-1485: Format track durations with hours
2019-03-08 10:55:04 +01:00
Philipp Wolfer
f0619614a3
PICARD-1485: Format track durations with hours
...
Durations of an hour or more will show the hours as HH:MM:SS
2019-03-08 10:24:12 +01:00
Philipp Wolfer
8608bf16e8
Merge pull request #1123 from zas/const.sys
...
Introduce picard.const.sys: IS_WIN, IS_MACOS, IS_LINUX, IS_FROZEN
2019-03-06 14:10:11 +01:00
Laurent Monin
1a9a86ff99
Move frozen stuff to picard.const.sys as IS_FROZEN and FROZEN_TEMP_PATH
2019-03-05 21:53:38 +01:00
Laurent Monin
6388ef20f5
Use IS_WIN, IS_MACOS, IS_LINUX
2019-03-05 21:53:32 +01:00
Laurent Monin
1f6adb07c2
Add constants IS_WIN, IS_MACOS, IS_LINUX to new picard.const.sys
2019-03-05 21:52:25 +01:00
Philipp Wolfer
6cc6e4d84e
PICARD-1483: Fix submitting AcoustId for non-album tracks
2019-03-05 17:45:29 +01:00
Laurent Monin
9a7b32316d
Merge pull request #1121 from zas/test_filesystem_cleanup
...
Test filesystem cleanup
2019-03-05 12:51:44 +01:00
Laurent Monin
9df54c1610
Introduce _assertFile()/_assertNoFile() and reduce redundancy a bit more
2019-03-05 11:03:23 +01:00
Laurent Monin
549800aa0a
Simplify even more
2019-03-05 10:54:42 +01:00
Laurent Monin
48206692de
Reduce code redundancy, introducing _move_additional_files(files)
2019-03-05 10:23:51 +01:00
Laurent Monin
5fa087dde3
Use a dict to store filepaths
2019-03-05 10:17:58 +01:00
Laurent Monin
6d78ff9ca3
Merge pull request #1115 from zas/file_cleanup
...
File cleanup
2019-03-04 22:53:01 +01:00
Philipp Wolfer
17464ab8dd
Bump API version to 2.2
2019-03-04 21:52:59 +01:00
Philipp Wolfer
fb08346030
PICARD-1400: Remove Amazon cover art provider
...
Will be provided as plugin
2019-03-04 21:52:59 +01:00
Laurent Monin
031172f0af
Test against File.LOOKUP_METADATA, more explicit, only 2 values possible
2019-03-04 21:51:29 +01:00
Laurent Monin
3582462b97
Introduce File.LOOKUP_ACOUSTID and File.LOOKUP_METADATA
2019-03-04 21:51:29 +01:00