Commit Graph

746 Commits

Author SHA1 Message Date
xoza 4768cb9efb Skip subsonic multi-genre tags 2023-10-12 12:27:43 +01:00
Marcus Müller 8e47ab59e5 internet services: consistently use 'override'
Signed-off-by: Marcus Müller <marcus_clementine@baseband.digital>
2023-09-17 12:43:13 +01:00
Jason Freidman 72c2336d94 Fix ClassicalRadio.com and ROCKRADIO.com #5616
These two audio addict feeds do support premium -- Perhaps they didn't previously. This changes fixes the playlist not loading for me on a local build.

This was changed in https://github.com/clementine-player/Clementine/issues/4582
2022-09-22 12:45:13 +01:00
John Maguire a551c40c4e Remove Spotify playback support
libspotify is dead
2022-09-01 22:55:44 +01:00
Jim Broadus 102317e5c8 internet/podcasts: Fix crash when updating podcasts.
When a podcast is updated and the number of visible items is set in the
podcast settings, child items that disappear from the view, and are
deleted, are still referenced by the database id map.

Move the removal code from SubscriptionRemoved to a common method and
use that for this case.
2021-07-26 12:36:24 +01:00
kentsangkm 6982b47819 Search song from Spotify via web api 2021-07-18 10:45:10 +01:00
Jonas Kvinge daa2f25e3c Replace Q_ENUMS with Q_ENUM
Q_ENUMS is obsolete. See: https://doc.qt.io/qt-5/qobject-obsolete.html
The replacement is Q_ENUM which was introduced in Qt 5.5, and Clementine
requires Qt 5.6.
2021-07-14 10:19:28 +01:00
Jonas Kvinge f379ad84d4 Fix use of emit
Adds missing emits.

QTreeView::collapse and QTreeView::expand are slots, not signals. So
remove emit.
2021-07-14 10:18:47 +01:00
Jim Broadus a5e84bbe98 internet: Add common InternetService::ConfigRequired() method.
This will allow some common handling of unconfigured services.
2021-07-07 10:47:01 +01:00
Jim Broadus a5fd484a61 internet: Consolidate ShowConfig methods.
InternetService::ShowConfig() and ShowSettingsPage() were used to show
the settings page for a service.
2021-07-02 11:54:21 +01:00
kentsangkm cbe384d142 Add override 2021-06-30 22:05:18 +01:00
Jim Broadus 6240fd3d0a player: Fix crash on UrlHandler error.
In a case where a playlist is composed entirely of unresolvable
internet service URLs and the playlist is set to repeat, playing an
item will result in an infinite (until crash) recursive condition.
HandleLoadResult is called with a NoMoreTracks result. It then calls
NextItem, which calls PlayAt for the next item, which, again, calls
HandleLoadResult.

This can be reproduced by logging into a subsonic server, adding items
to an empty playlist, then signing out.

To solve this, separate the error condition from the NoMoreTracks
result. Handle URL resolution errors the same way that media playback
errors are handled, where an error count is incremented and the player
stops if a limit is reached. The common code also notifies the playlist
of the error and provides user feedback by graying out the item.
2021-06-21 12:52:25 +01:00
Fabio Bas 058fe6f4be fall back to url if url_resolved is empty 2021-06-02 22:40:13 +01:00
Fabio Bas 38ac0d3ccb Radiobrowser.info: use the url_resolved field for radio stations 2021-06-02 22:40:13 +01:00
Fabio Bas 354f6a23e0 snake_case for variable names; reworked url resolution signals 2021-04-07 14:22:15 +01:00
Fabio Bas 91e1e5880d Fix compilation on older Qt, use Player::SongChangeRequestProcessed() signal to handle station play count 2021-04-07 14:22:15 +01:00
Fabio Bas cd561af516 radiobrowser url handler: emit metadata for radio stations 2021-04-07 14:22:15 +01:00
Jim Broadus 3b8519fda3 internet: Move page creation to internet category class
This consolidates most of the knowledge of internet settings pages in
the internet subdirectory. The exception is the master page enumeration
in the settings dialog.
2021-04-06 14:05:00 +01:00
Jim Broadus 1de6a46e86 internet: Add InternetSettingsCategory class 2021-04-06 14:05:00 +01:00
Jim Broadus c394d7d2dd settings: Don't connect service-specific signals to every page
Wii and notifications signals are currently connected for every settings
page. Move the signals from the base SettingsPage class into the derived
classes and connect the signals for only those objects.
2021-03-24 10:31:52 +00:00
Jim Broadus 05e450c3c3 internet/core: Move core ShowContextMenu to base class
Move CloudFileService::ShowContextMenu to the base class so that all
services can utilize the pattern established in CloudFileService.
ShowContextMenu creates the menu if it doesn't exist then calls an
overridable method to populate the content. It then calls an update
method before showing the menu.
2021-03-18 11:16:14 +00:00
Jim Broadus 5ebd6d1e6b internet/core: Move context_menu_ to base class
Every internet service class has a context_menu_ member. Moving this to
the base class will allow the consolidation of common menu functionality.
2021-03-18 11:16:14 +00:00
Fabio Bas 89e9b20df1 Use smart pointers for menus; move static vars and most private methods to an anonymous namespace 2021-03-16 11:03:00 +00:00
Fabio Bas 3ba2c811f4 Different context menu for service and stations; "add to your radio streams" action for stations; reworked server error handling 2021-03-16 11:03:00 +00:00
Fabio Bas 6a45edaa34 Removed dirty hack in InternetModel; added "radiobrowser:" url handler; rework station play callback 2021-03-16 11:03:00 +00:00
Fabio Bas cd062f1d8b Added settings page 2021-03-16 11:03:00 +00:00
Fabio Bas cc0cedc5bd added station art 2021-03-16 11:03:00 +00:00
Fabio Bas 3e31094227 Initial RadioBrowser support: implemented search, groups by category, top 100 2021-03-16 11:03:00 +00:00
Fabio Bas e7768948e0 Initial radio-browser.info support 2021-03-16 11:03:00 +00:00
Jim Broadus 10bf5dc171 internet/core: Remove unused ItemDoubleClicked
ItemDoubleClicked became noop in 70429217c.
Usage of PlayBehaviour_DoubleClickAction was removed in b08172138.
2021-03-13 18:27:10 +00:00
Jim Broadus 05f513ab6f skydrive: Add rescan option
Add menu option to drop all items from the database and rescan the cloud
drive.
2021-02-27 13:14:23 +00:00
Jim Broadus c87409c896 cloudfileservices: Refactor context menu code
Add PopulateContextMenu, called once to populate the menu items, and
UpdateContextMenu, called ever time a menu is shown, to allow
service-specific behavior.
2021-02-27 13:14:23 +00:00
Jim Broadus b57e66dd51 cloudfileservices: Common rescan confirmation dialog
Move Google Drive's rescan confirmation dialog to CloudFileService for
reuse.
2021-02-27 13:14:23 +00:00
Jim Broadus 5767317678 onedrive: Update to use graph api
The live API was deprecated in 2018. This change implements basic
onedrive access using the MS graph API.

The URL scheme was also changed from skydrive to onedrive. This is based
on the assumption that existing playlists won't have compatible item
ids.

Known issues:
- Directories with over 200 items will be truncated.
- No mechanism for discovering changes at runtime.
- No mechanism for removing deleted items or rescanning.

Reference: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/migrating-from-live-sdk?view=odsp-graph-online
2021-02-26 11:18:49 +00:00
Jim Broadus 7b5d2fd79f onedrive: Fix authentication
Discontinue use of obsolete auth endpoints. Update the name of the
settings group as well since the existing skydrive settings are no
longer useful.

Reference: https://docs.microsoft.com/en-us/onedrive/developer/rest-api/concepts/migrating-from-live-sdk
2021-02-26 11:18:49 +00:00
Jim Broadus 565110e223 onedrive: Fix json response parsing
Discontinue use of incorrect and obsolete QJsonDocument::fromBinaryData
method. Utilize common InternetService::ParseJsonReply instead.
2021-02-26 11:18:49 +00:00
Joe Robinson bce55d0efc Fix cover art query for Subsonic-based Funkwhale servers 2021-02-26 11:16:55 +00:00
Jim Broadus b40d9ed44b oauth: Fix redirect
Query params were not added to redirect url prior to inclusion in oauth
request. This change fixes OneDrive authentication.

Regression introduced in 8b226c2171
2021-02-21 14:18:17 +00:00
Jim Broadus 1a3828e2c1 protobuf: Fix namespace conflict
Protobuf 3.15 adds a namespace alias for "pb" that conflicts with
Clementine's. Modify Clementine to use "cpb".

Patch provided by @ahesford

Reference: 5c028d6cf4/src/google/protobuf/port.h (L44)
2021-02-21 14:17:26 +00:00
Jim Broadus 57a6fe4f20 utilities: Add common method for bug report URL generation
Move code from PodcastParser::ParseItem for reuse.

Example:
Calling Utilities::MakeBugReportUrl("New bug") returns:
https://github.com/clementine-player/Clementine/issues/new?title=New%20bug
2021-02-03 00:32:00 +00:00
Benjamin Valentin 3efa68f07d internet/soma.fm: use high quality AAC stream
Prefer the high quality 130 kbit/s AAC stream over the 'fast' 128 kbit/s
mp3 stream.
2021-01-01 18:00:59 +00:00
Matthieu Bruel 9714b0632d All changes for ClemRemote v1.0 (in one go) 2020-12-17 12:23:30 +00:00
Jim Broadus ccba649f62 Clear cached indexes in InternetModel when rows are removed
When opening a context menu on an internet item, the selected items are stored
in the InternetModel instance. In cases when the items are removed, certain menu
options can cause a crash. A specific case is downloading a podcast when the
user has chosen to limit the number of visible episodes. The subtree for the
podcast is rebuilt after the download completes, so if a context menu was opened
during the download time, selecting the append to playlist option will attempt
to operate on bad indexes.

This fix uses the rowsAboutToBeRemoved signal to remove these stored indexes.

There are likely another rare cases where the indexes can become invalid. For
example, sibling items within a subtree may be removed, causing the stored
indexes to become incorrect or out of range.
2020-12-15 22:36:30 +00:00
Jim Broadus fc4cb6fc7a Fix opml import crash
The opml parsing code handles cases where there are extra levels in the xml file
by copying the child to the main container. This corrupts the source instance
during the copy, which leads to corruption in the destination, and ultimately a
crash when it is later used.

To fix, do the copy in two steps, copying the child container to a temporary
location before copying to the destination.
2020-10-17 09:12:22 +01:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +01:00
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