Commit Graph

7535 Commits

Author SHA1 Message Date
Michael Wiencek
da981ee5d9 Merge pull request #128 from kepstin/vocals-rel-fix
Fix performed vocals relationship with no vocal type set
2013-06-15 15:55:35 -07:00
Michael Wiencek
3a0d7555ac Merge pull request #119 from zas/searchmbid
Make Picard search box smart enough to detect mbids.
2013-06-15 15:05:08 -07:00
Calvin Walton
513b51d730 Fix performed vocals attribute with no vocal type set
This fixes a regression since e16b2533c where picard no saves vocal ARs
with no type set as generic "performer" ars; appearing in the UI like
    Performer []: Some Vocalist
    Performer [guest]: Some Guest Vocalist

Add special handling for the vocal relationship type to use a fallback
string if there is no vocal type set. The fallback string is "vocals"
(earlier versions of picard used "vocal"), for consistancy with the
current vocal type strings, which look like "lead vocals", "background
vocals", etc.
2013-06-15 12:04:19 -04:00
Ionuț Ciocîrlan
e33a144ea5 Merge remote-tracking branch 'upstream/master' 2013-06-15 13:37:56 +03:00
Ionuț Ciocîrlan
e47aec2b63 small calculation fix 2013-06-15 13:32:34 +03:00
Michael Wiencek
aaea3d4f54 Better metadata box locking
The previous use of "selection_mutex" didn't really prevent race conditions.
The only thing really stopping them was the hackish "throttling" implemented
using self.updating and self.update_pending. If self.update was called while
another update was already in-progress, it'd set self.update_pending to True
and return, thereby reducing the chance that two update threads would execute
simultaneously.

Another thing to note is that race conditions here are almost impossible to
reproduce in CPython by default, because the interpreter only checks for
possible thread switches every 100 virtual instructions or so (configurable
using sys.setcheckinterval). Still, relying on such behavior bothers me.

The new attempt here reduces the need for locking considerably, because
instead of having a constant, shared self.tag_diff object, each update
thread creates its own and passes it on as the result.

So, selection_mutex is now simply used to protect the cached selection vars
while they're being set in _update_selection and read in _update_tags. As
mentioned, CPython's default behavior makes selection_mutex pretty much
unnecessary, but I don't think it adds much overhead given its limited use.

Tested on Mac and Windows.
2013-06-15 00:44:54 -05:00
Ionuț Ciocîrlan
9bb1cc267d Merge remote-tracking branch 'upstream/master'
Conflicts:
	picard/file.py
2013-06-14 22:04:53 +03:00
Michael Wiencek
d1c611d805 Remove leftover from #116 2013-06-14 13:33:05 -05:00
Ionuț Ciocîrlan
1b695eea63 small fixes and some comments 2013-06-14 21:18:25 +03:00
Michael Wiencek
69ba093a3b Merge pull request #120 from zas/picard-480
PICARD-480: add few missing tags to ASF/WMA format
2013-06-14 10:56:36 -07:00
Michael Wiencek
7f55ba67b5 Merge pull request #116 from zas/front_image
When "save_only_front_images_to_tags" is set, save only 1 front image.
2013-06-14 10:50:08 -07:00
Ionuț Ciocîrlan
9a8bb4ef94 path shortening that takes into account different encodings 2013-06-14 19:24:59 +03:00
Ionuț Ciocîrlan
540e824224 readability improvements 2013-06-13 12:45:44 +03:00
Laurent Monin
65a593aecf When "save_only_front_images_to_tags" is set, save only 1 front image.
Introduce helpers to clarify and fix code:
- is_front_image()
- save_this_image_to_tags()
- image_type_from_id3_num()
- image_type_as_id3_num()

Fixes:
- honor "save_only_front_images_to_tags" option for apev2 format too
- save only caa front image to tags when "save_only_front_images_to_tags" is set
  and image source is CAA, use 'front' flag from json.
  Other sources should have only 1 front image anyways.
2013-06-13 08:48:55 +02:00
Michael Wiencek
2c375d788c If there's no ~length, use 0 as the fallback, not [""]
Otherwise, format_time raises an exception.
2013-06-11 22:55:00 -05:00
Michael Wiencek
b58caa4805 Fix file renaming examples after 7c4fdf76
The _make_filename and _script_to_filename methods actually *do* need
to be passed a custom settings dict, so that the renaming examples
can update instantly.
2013-06-11 12:40:16 -05:00
Ionuț Ciocîrlan
28ecc5c1b5 small oops 2013-06-11 19:40:46 +03:00
Ionuț Ciocîrlan
6d8c912006 Merge remote-tracking branch 'upstream/master'
Conflicts:
	picard/file.py
	picard/ui/options/renaming.py
2013-06-11 19:37:10 +03:00
Michael Wiencek
caa52006ee Merge pull request #124 from Sophist-UK/sophist_fix_test_formats_after-status_counters_update
Fix format test file
2013-06-11 09:15:27 -07:00
Sophist
2c3cb1bf02 Fix format test file 2013-06-11 16:51:26 +01:00
Ionuț Ciocîrlan
c2874ed671 tests and subsequent fixes 2013-06-11 18:19:15 +03:00
Laurent Monin
80a2296bc8 Use ASIN instead WM/ASIN, as discussed with ijabz. 2013-06-11 13:49:24 +02:00
Laurent Monin
51ea26f8cc Complete the list of known entities. 2013-06-11 12:43:29 +02:00
Laurent Monin
86e8db315b Make Picard search box smart enough to detect mbids.
If a release mbid is given (search type = Album) it will try to load it as
when using web browser tagger link.

If string looks like a known entity (artist, release-group, label, track)
it will open browser on corresponding url.

Examples:
Select box on Album + "abb7caf1-ac93-48e1-a066-60caad07e1a7" -> load release (http://musicbrainz.org/release/abb7caf1-ac93-48e1-a066-60caad07e1a7)

Select box on anything + "http://musicbrainz.org/artist/c19ff12b-058f-44a8-b245-b0efb4752925" -> open browser on Artist page
"ARTIST := c19ff12b-058f-44a8-b245-b0efb4752925 !!" -> open Artist page
2013-06-11 10:02:12 +02:00
Laurent Monin
6ba5697747 PICARD-480: add few missing tags to ASF/WMA format 2013-06-11 10:01:56 +02:00
Michael Wiencek
f095a0de57 Merge branch 'zas-cdbaby' 2013-06-10 22:58:14 -05:00
Michael Wiencek
c724687943 small whitespace fix 2013-06-10 22:58:00 -05:00
Michael Wiencek
1503ebff92 Merge branch 'Sophist-UK-sophist_improve_status_counters' 2013-06-10 22:50:49 -05:00
Michael Wiencek
60041b6b4a Merge branch 'sophist_improve_status_counters' of git://github.com/Sophist-UK/picard into Sophist-UK-sophist_improve_status_counters 2013-06-10 22:48:41 -05:00
Laurent Monin
50fdd327f8 Do not add cover art relation url twice (ie. cdbaby)
Stop loop if first url is added because second one will be removed later anyway.
It happens with cdbaby urls (ie. http://musicbrainz.org/release/6e228dfa-b0c7-4987-a36d-7ac14541ae66)


Debug output without this patch:
D: 139947473626880 11:15:32 There are no suitable images in the cover art archive for 6e228dfa-b0c7-4987-a36d-7ac14541ae66
D: 139947473626880 11:15:32 Adding front image PyQt4.QtCore.QUrl(u'http://cdbaby.name/p/r/prozak.jpg')
D: 139947473626880 11:15:32 Adding front image PyQt4.QtCore.QUrl(u'http://www.cdbaby.com/cd/prozak')
D: 139947473626880 11:15:32 'Downloading http://cdbaby.name:80/p/r/prozak.jpg'


Debug output with this patch:
D: 140074644940544 11:16:55 There are no suitable images in the cover art archive for 6e228dfa-b0c7-4987-a36d-7ac14541ae66
D: 140074644940544 11:16:55 Adding front image PyQt4.QtCore.QUrl(u'http://cdbaby.name/p/r/prozak.jpg')
D: 140074644940544 11:16:55 'Downloading http://cdbaby.name:80/p/r/prozak.jpg'
2013-06-10 11:23:17 +02:00
Sophist
0b585231ed On Windows display drives in sorted order in FileBrowser 2013-06-09 23:39:31 +01:00
Sophist
ed8456766e Address review comments 2013-06-09 23:37:09 +01:00
Sophist
3e20ea8f91 Add cluster count 2013-06-09 23:37:07 +01:00
Sophist
19406402a6 Rename stuff to better reflect usage 2013-06-09 23:37:06 +01:00
Sophist
f39c3c9f3d Provide more consistent status bar info and code
Still need to make "Unmatched Files" and "Clusters" FileTreeItems
consistent.
2013-06-09 23:37:03 +01:00
Sophist
31600b1bcf Remove un-needed num_saves method 2013-06-09 23:37:01 +01:00
Sophist
df40b37b2d Provide better activity stats in the status bar
Partial solution to PICARD-478
2013-06-09 23:37:00 +01:00
Michael Wiencek
0482724b5b Fix exception caused by 3f6c64d
If metadata.length is 0, it's Falsy and not added to the tagdiff stuff. This
stores it as a str because it's simpler than adding `or value != 0`
everywhere.
2013-06-09 09:11:11 -05:00
Laurent Monin
9f213b15fc Display cover art images sizes and dimensions in Info dialog 2013-06-09 14:23:23 +02:00
Laurent Monin
d2005ddd4c Use bytes2human to display file size in Info dialog. 2013-06-09 14:23:23 +02:00
Laurent Monin
6de59d8ee9 Add functions to convert bytes to human readable form.
Binary and decimal modes are supported (MB and MiB ie.)
It supports i18n using gettext and locale.
Precision can be modified if needed, by default it is using 1 digit (if needed).

Extensive tests were written, the toughest was to make them work for
both default C locale and fr_FR.UTF-8 locale (ofc it is possible to test for more
locales...). If one locale isn't available on testing system, test is skipped.
fr locale was chosen because decimal point is replaced by a comma and byte units
becomes "octet" units (1.5 MB in english -> 1,5 Mo in french).
2013-06-09 14:23:23 +02:00
Laurent Monin
429242f1c8 Modify and move setup_gettext() in its own file.
Unit tests will need to use gettext, so i modified a bit setup_gettext()
and it can now be easily imported.
I add to change the code a bit to make it work, i also fixed an issue with
locale under linux that was occuring when one imported this module.
2013-06-09 14:20:43 +02:00
Wieland Hoffmann
468ac1f252 Add a comment explaining the fix for PICARD-417 2013-06-09 12:22:59 +02:00
Wieland Hoffmann
355bc42c18 PICARD-417: Re-add the signals of rename_files
Those got lost in efd5277
2013-06-09 12:22:59 +02:00
Wieland Hoffmann
1a21eaa771 Use picard.util.partial instead of functools.partial 2013-06-09 12:13:17 +02:00
Wieland Hoffmann
f0231f7530 Do not rely on Pythons conversion from int to bool when connecting slots
The stateChanged signal of QCheckBox emits an int but the setEnabled slots
expect a bool.
2013-06-09 12:13:17 +02:00
Wieland Hoffmann
201cdc269c Merge branch 'importable-config-log' of https://github.com/mwiencek/picard into mb-master
Conflicts:
	picard/plugin.py
2013-06-09 11:56:15 +02:00
Wieland Hoffmann
c90d523493 Merge branch 'master' of https://github.com/brainz34/picard into mb-master 2013-06-09 11:52:53 +02:00
Wieland Hoffmann
0a88c62fe0 Regenerate picard.pot
New strings include those for collection management and cover art types.
2013-06-09 11:51:20 +02:00
Wieland Hoffmann
83d3dc0e6b CAA: Correctly deal with images with no type set
Those have an empty "types" list - we need to add a type because
_caa_append_image_to_try_list expects one to be there.
2013-06-09 10:30:47 +02:00