Commit Graph

701 Commits

Author SHA1 Message Date
Jim Broadus ad882cc999 Add static IsTypeSupported methods to playlist item classes 2020-06-23 11:06:06 +01:00
Jim Broadus 76a24a0a28 Use DbPlaylistItem base class for Jamendo and Magnatune
Moving these from LibraryPlaylistItem removes local file specific
implementations of IsLocalLibraryItem and Reload. Returning true for
IsLocalLibraryItem caused ratings to be set on unrelated library songs.
2020-06-19 11:18:32 +01:00
Jim Broadus 84099f2491 Name all threads created by Application
In Application::MoveToNewThread, name the new thread after the object being
moved. Give those objects names as well.

The thread names display in gdb with "info threads".
2020-05-27 10:22:00 +01:00
dmdmdm 7caf200efa Added CBC Podcasts 2020-05-21 02:04:08 +01:00
Jim Broadus 879dfa3d79 icecast: free backend on exit
Use a shared pointer since the model and search provider both hold pointers to
the backend object. Also removed unused accessor method.
2020-05-20 21:33:47 +01:00
Jim Broadus 83fc376b08 subsonic: Consolidate read song code 2020-05-14 11:01:22 +01:00
Jim Broadus ddba21a46f subsonic: Move ReadSong method to SubsonicService. 2020-05-14 11:01:22 +01:00
Jim Broadus 5efcae398e subsonic: Use correct URL query params to fetch cover 2020-05-13 22:23:40 +01:00
Sophie Tauchert ef3021dff2 Add tasks back in using ScopedTask 2020-04-12 21:03:18 +01:00
Sophie Tauchert 38a5d183c2 Cache SubsonicService in SubsonicDynamicPlaylist 2020-04-12 21:03:18 +01:00
Sophie Tauchert 69801a9e2a Print error on default dynamic playlist type 2020-04-12 21:03:18 +01:00
Sophie Tauchert af28ad31f1 Remove boost references 2020-04-12 21:03:18 +01:00
Sophie Tauchert 665f7af929 Be more forgiving when fetching albums/songs 2020-04-12 21:03:18 +01:00
Sophie Tauchert 8964c8131f Add dynamic playlist for random songs 2020-04-12 21:03:18 +01:00
Sophie Tauchert 1d582ba158 Fix songs in dynamic subsonic playlist 2020-04-09 13:49:21 +01:00
Jim Broadus a22af31e6e Add a common LibraryBackend::Init method.
Most users of LibraryBackend pass empty strings for directory and subdirectory
tables, so add a second Init method that omits those.
2020-03-24 14:10:43 +00:00
Jim Broadus 52337bf7a4 Use legacy RedirectPolicyAttribute instead of FollowRedirectsAttribute.
RedirectPolicyAttribute was introduced in Qt 5.9, but Debian Stretch is at 5.7.
This change can be reverted when the base support version moves to 5.9.
2020-03-23 18:45:25 +00:00
Jim Broadus a85b3531c3 Handle redirects when downloading Spotify blob.
Use the NoLessSafeRedirectPolicy policy which will redirect as long as it isn't
from https to http.
2020-03-23 09:58:15 +00:00
Jim Broadus 8e6d09d445 Handle google drive token.
Use LoadResult auth header mechanism to pass auth token to pipeline as a header
instead of obsolete query string method.
2020-03-12 18:08:14 +00:00
Jim Broadus 2f36b34c33 Remove some user info from logs. 2020-02-18 09:03:08 +00:00
Jim Broadus 4f9b81459a Remove leading / from google file id.
The Google Drive Client::GetFile currently fails due to an extra / in the
request. Use QString::remove to strip all "/" characters from the id.

Note: While this fixes the ability to get the media URL, a change to the
Google Drive API breaks the playback. This will be addressed in a future
commit.
2020-02-18 09:03:08 +00:00
Jim Broadus f81533bb58 Handle Google Drive get file errors.
When a call to translate a file ID to a URL fails, tell the user and
don't try to load the file.
2020-02-18 09:03:08 +00:00
Jim Broadus a0bb8ab3a1 Replace closures with new Qt functor variant of connect. 2020-02-15 15:00:49 +00:00
Jim Broadus 58e59adcfc Pass correct type to FetchContentUrlFinished. 2020-02-15 15:00:49 +00:00
Jim Broadus b86b8a45cc Fix dropbox json parsing.
Incorrect QJsonDocument::fromBinaryData was used several places in
DropboxService. Add a single ParseJsonReply method to the base class that
properly checks and parses network replies and reports errors.
2020-02-15 15:00:49 +00:00
Jim Broadus 61de3c6e93 Convert remaining QJsonValue::isUndefined usage.
Noted previously, using the [] operator on a non-const QJsonObject causes the
creation of the key and does not work for checking existence. Convert the
remaining isUndefined call sites to use QJsonObect::contains.
2020-02-13 11:12:52 +00:00
Jim Broadus a5db937d23 Fix itunes search.
Using the [] operator on a non-const QJsonObject inserts an item. The test
for an error message was always positive. Use the contains method instead.
2020-02-12 09:53:45 +00:00
Jim Broadus 18a08e87c2 Add a directory_model accessor to Application class. 2020-02-11 08:09:22 +00:00
Jim Broadus efb4f8a15a Handle errors from icecast directory requests.
When a request fails, show an error dialog and don't attempt to parse results.
2020-02-07 10:06:14 +00:00
Jim Broadus 2132310873 Display message to user when IntergalacticFM channel list fails.
At the time of this commit, the channel list from intergalactic.fm is
unavailable. To the user, this is failing silently. Add an error message for
this failure. If this issue persists, then the service should be removed or a
hardcoded station list should be used.
2020-02-07 10:05:39 +00:00
Jonas Kvinge f674847431 Use HTTPS 2020-01-27 22:46:38 +01:00
Jim Broadus 6a9276ec0a Fix LibraryModel async query crash.
A LibraryBackend may be deleted while an associated LibraryModel object is using
it. An example is an async query running while a connected device is removed.
To prevent this, use a share pointer for the LibraryBackend.

This fixes one case where LibraryBackend is used after deletion. However, the
raw pointer is still passed around in several other places. These should be
evaluated on a case-by-case basis to insure that circular depencencies aren't
introduced.
2020-01-14 21:47:31 -08:00
Pavel Liavonau 3f4c788339 Fixed lastfm workflow with "now playing" and scrobbling feature
(Maybe Issue #2672)
2020-01-07 22:29:23 +00:00
John Maguire 57841cf947
Merge pull request #6515 from jonaski/child
Replace QModelIndex::child() with QAbstractItemModel::index()
2020-01-06 00:11:22 +00:00
Jonas Kvinge 6b50d5140d Fix formatting 2020-01-05 19:09:03 +01:00
Jonas Kvinge 959a957a56 Replace QModelIndex::child() with QAbstractItemModel::index() 2020-01-05 18:37:27 +01:00
John Maguire 0991209087
Revert "Add an option to specify a gpodder server." 2020-01-05 17:10:00 +00:00
John Maguire 41c103413c
Merge pull request #6497 from jbroadus/gpodder-server
Add an option to specify a gpodder server.
2020-01-05 15:27:08 +00:00
John Maguire 10e807dd7d
Merge pull request #6509 from jonaski/tolist
Replace QSet::toList() with QSet::values()
2020-01-05 15:13:33 +00:00
Jonas Kvinge 5eb32b33c1 Replace QSet::toList() with QSet::values() 2020-01-05 00:58:33 +01:00
Jonas Kvinge ddc8a5f010 Initialize QObject in constructor and add explicit 2020-01-05 00:21:04 +01:00
Jim Broadus 590d7f3823 Add an option to specify a gpodder server.
Add an "Advanced Settings" option to the gpodder sign in. If selected, a fully
qualified URL must be specified as the gpodder base. Upon successful login, the
URL is saved along with username and password. If advanced settings are not
selected, an empty URL is stored and the default will be used.
2020-01-03 22:46:15 -08:00
Jim Broadus e32ba7eac5 Gpodder login cleanup.
It's not necessary for the PodcastSettingsPage class to have knowledge of
GPodderSync's login implementation. Handling the network reply in a single
location sightly simplifies the code. It also makes the handling order
more deterministic.
2019-12-30 20:58:30 -08:00
Jim Broadus a1da067002 Reset gpodder session cookies on logout.
A sessionid cookie is stored when logging in to gpodder. After logging out, a
subsequent login with the same user name but incorrect password will succeed,
ignoring the authorization header. The incorrect password will be stored for
future use.

To fix this, reset the cookie jar for GPodderSync's network access manager at
logout.
2019-12-30 14:19:08 -08:00
Jim Broadus 36179a7197 Fix gpodder sync memory leaks in success cases.
A closure created by NewClosure that handles Qt signals is destroyed if the
signal object is destroyed, the slot object is destroyed, or the signal is
invoked. In the case where the sender is passed as a shared pointer, the
reference prevents the sender from being destroyed before the closure.

So for closures built to handle responses returned from ApiRequest in
GPodderSync, the closure object and the response object will only be destroyed
after the signal is invoked. In some cases, separate closures are built for
error signals as well. For these, only one closure will be destroyed. The other
closures and the response object will be leaked.

A simple fix for the success cases is to remove the unnecessary error case
closures and directly connect the signals to slots. This is low hanging fruit
and still leaves leaks in the error cases. Those cases will require a more
complete solution to properly manage the life cycle of the response object.
2019-12-29 10:11:29 -08:00
Jim Broadus 5e7e57df73 Set a 30 second timeout for gpodder requests. 2019-12-25 23:53:47 -08:00
John Maguire b7c3173001
Merge pull request #6439 from jonaski/signalmapper
Replace all uses of QSignalMapper with C++11 lambda expressions
2019-11-10 19:13:31 +00:00
Jonas Kvinge 344023e6dd Fix formatting 2019-11-10 15:16:39 +01:00
Jonas Kvinge ba31c755ef Replace all uses of QSignalMapper with C++11 lambda expressions 2019-11-10 15:07:12 +01:00
John Maguire 21da802630
Merge pull request #6438 from jonaski/remove-extra-semicolon
Remove extra ';'
2019-11-10 00:53:37 +00:00