Commit Graph

7535 Commits

Author SHA1 Message Date
Rahul Raturi
795a42f027 Update window title to be consistent 2016-09-05 11:11:34 +05:30
Rahul Raturi
518212db8e Update comments and remove unnecessary ones
Also add copyright information.
Signed-off-by: Rahul Raturi <rhlrtr44@gmail.com>
2016-09-05 11:11:34 +05:30
Rahul Raturi
46b6c4e0ec Update advanced syntax setting instantly...
... with checkbox state changes.Updating the state and reopening the dialog
for it to actually affect the query seems counter intuitive. Also, no need to
save state when dialog closes, as the setting will already be updated.
2016-09-05 11:11:34 +05:30
Rahul Raturi
ca058262bb Check for label element's children
In some nodes, empty `label` element may exist. In such cases, exception
is thrown when trying to access label name.
2016-09-05 11:11:34 +05:30
Rahul Raturi
8d87e17d28 Don't use album dialog for unmatched file cluster 2016-09-05 11:11:34 +05:30
Rahul Raturi
2eb2a501d4 Rename some variables and update text 2016-09-05 11:11:34 +05:30
Rahul Raturi
7a84cf9ca3 Display query when searching cluster
Also, update comments to be more specific and concise.
2016-09-05 11:11:34 +05:30
Rahul Raturi
8ca51c8846 Minor fixes: Use named tuple in album dialog ...
... and replace `len(list)` with just `list` for testing whether it's
empty or not, as it's more pythonic.
2016-09-05 11:11:34 +05:30
Rahul Raturi
db81a7b059 Display cover arts of searched releases 2016-09-05 11:11:34 +05:30
Rahul Raturi
e52135fd83 Connect album dialog to main window 2016-09-05 11:11:34 +05:30
Rahul Raturi
89e268341a Setup album search dialog
The dialog is somewhat analogous to track search dialog. Some noticeable
points are:

* Allow searching for albums from clusters, by right clicking.
* Move save and restore state/size logic to individual classes, from parent
class `SearchDialog`. Both dialogs have different number of columns, and
elements.
2016-09-05 11:11:34 +05:30
Rahul Raturi
f8559fdd7c Move code to extract iso codes to separate method 2016-09-05 11:11:34 +05:30
Rahul Raturi
c5ba18392e Don't use count element...
... for purpose of extracting label information. Reason being, `count`
element isn't present in `label_info_list` element of search xml.
Checking for length of children has same effect as with checking count
element.
2016-09-05 11:11:34 +05:30
Wieland Hoffmann
b0a70febf9 Allow mutagen >1.34 on travis
Mutagen 1.34.1 added some compatibility imports for Picard and we now no
longer even depend on them, so lift the restriction on mutagen versions.
2016-08-22 22:05:45 +02:00
Wieland Hoffmann
f5e3a5c1be Don't allow tests to fail on mutagen==1.34 2016-08-22 22:05:00 +02:00
Laurent Monin
fb3e993edc Merge pull request #479 from lazka/remove-mutagen-hacks
id3: Remove various mutagen hacks which no longer work with newer mutagen
2016-08-22 21:40:27 +02:00
Christoph Reiter
6ed354406a id3: Remove various mutagen hacks which no longer work with newer mutagen
Three parts:

(1) The monkey patching of EncodedTextSpec to ignore encoding errors
when using latin1 as encoding.

This gets replaced with a new id3text function which makes sure
that any value passed to mutagen can be encoded with the selected
encoding

(2) MultiSpec monkey patch to not null terminate a list of strings.

While this is valid according to the spec mutagen decided to terminate
all strings (not only the text lists handled here). If this is a
problem it should be discussed upstream (mutagen).

(3) compatid3 which implemented id3v2.3 support and added some
additional frames.

This gets replaced with the id3v2.3 support implemented upstream.
The additional frames still get passed to mutagen and, to match
the previous implementation, update_to_v23() gets wrapped to
allow some v2.4 only frames.

The newly added id3v2.3 code depends on mutagen 1.22+
2016-08-22 20:26:38 +02:00
Michael Wiencek
31555edd3a Merge pull request #475 from rahul-raturi/embed_search
Searching tracks and displaying similar tracks in a dialog box.
2016-08-14 21:52:30 -05:00
Rahul Raturi
d33ba59d07 Fix multiple widgets appearing in center layout
This happens with displaying error. New widgets may appear without
existing being cleared. To avoid this:
1. Pass parent widget to `error_label` so it gets removed with parent.
2. Use `takeAt` rather than `itemAt` as it's more suitable for removing
widgets according to Qt docs. For reference:
http://doc.qt.io/qt-4.8/qlayout.html#itemAt and
http://doc.qt.io/qt-4.8/qlayout.html#takeAt
2016-08-12 01:58:00 +05:30
Wieland Hoffmann
ed50ccc598 Merge pull request #481 from scop/svg-icon
Install SVG icon
2016-08-10 22:51:36 +02:00
Rahul Raturi
d9ebd73a95 Escape lucene query from filter values 2016-08-06 23:41:31 +05:30
Rahul Raturi
c6b9273b43 Use namedtuples instead of simple ones 2016-08-06 23:41:29 +05:30
Rahul Raturi
62bd512662 Improve code semantics and style
Some noticeable points:
* `save_state` can check whether table is loaded or not. No need to
check it in `accept` and `reject`. Also `table_loaded` isn't required
anymore.
* Keep file formats list in alphabatic order, in `makeqrc.py`.
* Import `Track` and use `isinstance` to check whether object belongs to
it.
2016-08-06 23:16:33 +05:30
Rahul Raturi
7f3c6afbaf Remove unnecessary import
`artist_credit_from_node` is not required as `recording_to_metadata`
uses it internally.
2016-08-01 22:53:55 +05:30
Rahul Raturi
d1f516208a Add docstrings and comments 2016-08-01 22:05:06 +05:30
Rahul Raturi
09a746105a Rename actions to more specific one 2016-08-01 21:52:30 +05:30
Rahul Raturi
dd5ac9bc97 Default value of row is no longer required
From commit 8efcf98 onwards.
2016-08-01 19:38:13 +05:30
Rahul Raturi
9abd7ccaa1 Remove unnecessary initialization 2016-08-01 19:38:13 +05:30
Rahul Raturi
7b4e213a30 Move code to generate error message into methods
* This makes the code structure a bit cleaner
* Also these methods are likely to be reused in other dialog classes
2016-08-01 19:38:13 +05:30
Rahul Raturi
e9b0eacafb Fix missing parent argument for some widgets 2016-08-01 19:38:13 +05:30
Rahul Raturi
21da7e717a Display actual error when network request fails 2016-08-01 19:38:13 +05:30
Rahul Raturi
f53fb9c3f3 Replace progress label text
To reuse an existing translation.
2016-08-01 19:38:13 +05:30
Rahul Raturi
a637ff18ad Default value for getattr should be a string
And use single quote for uniformity.
2016-08-01 19:38:13 +05:30
Rahul Raturi
1692b84f39 Use double quote instead of backquote 2016-08-01 19:38:13 +05:30
Rahul Raturi
e47a245bd1 Save table header size on each resize
The ResultTable is resized using size information from
config.setting["searchdialog_header_state"]. As this value is updated
only when the dialog is closed, any ongoing changes (i.e. without
closing the dialog) will be ignored. This patch avoids that.
2016-08-01 19:38:13 +05:30
Rahul Raturi
7fd0b58e17 Display retry button only when request fails 2016-08-01 19:38:13 +05:30
Rahul Raturi
6413b895cd Add non breaking space to avoid text collapse 2016-08-01 19:38:13 +05:30
Rahul Raturi
cc4aac97b0 Add refresh button
This would allow user to re-perform the search, in case results
aren't displayed, without closing the dialog.
2016-08-01 19:38:13 +05:30
Rahul Raturi
e9881ca0de Add default value in case attribute isn't present
Happens if table isn't displayed ever. `self.table` wouldn't be
defined leading to AttributeError.
2016-08-01 19:38:13 +05:30
Rahul Raturi
56e6ad6e8d Unset corresponding object when widget is deleted
Exception can be generated after the table widget has been deleted. Say,
table is displayed first. But for next search, some network error
occurs. The table widget will get deleted by
`add_widget_to_center_layout` as soon as progress widget is displayed.
`self.table` would have the widget reference, but it's cleared from memory,
resulting in an exception, like -> "wrapped object has been deleted".
To avoid this, unreference `self.table` if corresponding widget is
to be deleted. The other two widgets namely `self.progress_widget` and
`self.error_widget` aren't (and probably wouldn't in future) accessed by
any other method. So, no need to explicity unreference them. They will
be reassigned a new widget when `show_progress` and `show_error` are called
respectively.
2016-08-01 19:38:13 +05:30
Rahul Raturi
80ddbee5de Set widget's object name 2016-08-01 19:38:13 +05:30
Rahul Raturi
06af62a06e Save dialog state on cancel
Also, use if/else logic rather than try/exception, as it makes
more sense. It's know where and why exception will be thrown, so
rather avoid that.
2016-08-01 19:38:13 +05:30
Rahul Raturi
f23a340414 Add paranthesis around link 2016-08-01 19:38:13 +05:30
Rahul Raturi
74dee64892 Use existing methods to parse results
There are existing methods to parse xml nodes of a recording. Use
them to avoid duplicating code.
For extracting country details, use separate functionality. Reason
being, current `release_to_metadata` method uses `country` element
to extract country details. This element is obsolete as there
can be multiple countries, and this element returns only one.
2016-08-01 19:38:13 +05:30
Rahul Raturi
ba8c904ec2 Don't use setMargin(), as it's obsolete
As mentioned here -> http://doc.qt.io/qt-4.8/qlayout-obsolete.html,
use `setContentsMargins()` instead.
2016-08-01 19:38:13 +05:30
Rahul Raturi
5b0b17ce06 Set object name for most top level widgets 2016-08-01 19:38:13 +05:30
Rahul Raturi
dd3b385b7e Use iso_3166_1_code element for country
The `country` element (used till now) is obsolete. It contains
information of a single country where album is released. Instead
extract all country codes from iso_3166_1_code_list element and
display them.
2016-08-01 19:38:13 +05:30
Rahul Raturi
a2e5f8aae9 Fix NAT support
This was mistakenly removed in f667b04.
This also fixes a minor grammatical mistake.
2016-08-01 19:38:13 +05:30
Rahul Raturi
a28da55af2 Separate track (dict) object for each release 2016-08-01 19:38:13 +05:30
Rahul Raturi
e68f31a8bb Do not display filters with null value
This leads to HTTP 400 error, server unable to parse query.
2016-08-01 19:38:13 +05:30