Commit Graph

5801 Commits

Author SHA1 Message Date
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 8f56fbb83b Fix timer errors on exit
The NetworkRemote is moved to a new thread after creation. On that thread, its
child classes create timers. When the network remote class is deleted on the
main thread, we see "Timers cannot be stopped from another thread".

To avoid this error, use deleteLater to delete NetworkRemote and its composition
classes on its own thread.
2020-05-19 10:39:06 +01:00
Jim Broadus 6a5cb0712d gstengine: Fix gtreamer request pad leak
According to the gst_element_request_pad documentation, request pads must be
released after usage. They aren't automatically released and dereferenced when
the element is destroyed.
2020-05-15 11:12:34 +01:00
Jim Broadus 58569d9d0d Remove fetcher list from OutgoingDataCreator class. 2020-05-14 11:01:49 +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
Jim Broadus 96a17c9f40 settings: Only save settings for visited pages
Set a flag when a page is shown. On apply or accept, only save if that flag is
set.
2020-05-12 10:21:44 +01:00
Jim Broadus 77badd37ff settings: Add dialog methods to settings pages
Add Accept, Apply, Reject methods to settings pages to mirror dialog. This will
allow settings pages to handle these events at a more granular level and will
allow common behavor in the base class.
2020-05-12 10:21:44 +01:00
Jim Broadus 096203ac88 visualisations: Fix close action
Pressing the close button on the window sends a close event, where other methods
of exiting visualization just hide the window. If shown again after close, the
window will be empty. To fix this, handle and reject the close event. Call hide
instead.
2020-05-09 13:28:29 +01:00
Jim Broadus 7e7d271b30 Properly handle removal of top level items in StandardItemIconLoader
The rowsAboutToBeRemoved signal from the model provides a parent index, but with
QStandardItemModel, top level items are added to an invisible root item that
doesn't have a valid index. This causes the range check to miss top level items
due to a perceived parent mismatch. When the load completes, it attempts to
access an object that has been deleted.
2020-05-04 10:09:51 +01:00
Jim Broadus dc4270076d Change StandardItemIconLoader to require a QStandardItemModel
This should be a safe assumption since the loader operates on QStandardItem
objects.
2020-05-04 10:09:51 +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 72ac3cb88c OSDPretty: Check return of current_screen in showEvent 2020-03-30 10:55:54 +01:00
Jim Broadus 33ffb4973a OSDPretty: Fall back to primary screen
If current screen can't be find, use primary screen. This the
current behavior when used with older qt versions.
2020-03-30 10:55:54 +01:00
Jim Broadus 8706a39559 OSDPretty: Consolidate current_screen code in OSDPretty 2020-03-30 10:55:54 +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 94eb2dcfc1 Preserve auth headers when redirecting.
When redirecting, copy the original request, which may include extra headers.
2020-03-13 10:38:47 +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 e338939c8b Add optional auth info to LoadResult.
Add auth_header_ to LoadResult. If it exists, populate the MediaPlaybackRequests
headers with an Authorization header with that value.
2020-03-12 18:08:14 +00:00
Jim Broadus 3c7b509d59 Add headers to MediaPlaybackRequest.
Add a name/value map for headers to MediaPlaybackRequest. When adding a new
gst source that accepts extra-headers (souphttpsrc), add these headers.
2020-03-12 18:08:14 +00:00
Jim Broadus 9ed5503ee3 Add MediaPlaybackRequest class.
Add a class to wrap the URL in the playback engines. In the future, this will
contain authentication information for the specified URL. It can also include
the start and end time as well as other data that is currently specified along
with the URL.
2020-03-11 10:57:21 +00:00
Jim Broadus 2c1ae986c5 Create a GstEngine::IsCurrentPipeline helper function for callbacks. 2020-03-09 10:21:07 +00:00
Power Snail 4fe845c2c5 Use reference on a const loop var to avoid copy
Clang 10 warns that ``s`` might be copied. Use a reference to avoid copying
2020-03-07 02:39:13 +00:00
Jonas Kvinge b762987cd6 Add missing mapToSource() in MainWindow::PlaylistRightClick 2020-03-06 11:10:02 +00:00
Jim Broadus 90cf4988ea Fix crash when searching playlist.
While iterating over expandList in refreshExpanded, calls to setExpanded cause
the list to be appended. Since QList uses an array implementation that must
reallocate when reserved space is exhausted, iterators are unsafe for this case.
Use indexes, which are O(1) in QLists, instead of iterators.
2020-02-24 13:45:42 +00:00
PowerSnail 531cd052ca use QT's High DPI attribute 2020-02-24 13:44:09 +00:00
Jim Broadus a8f656a933 Shortcut settings page cleanup.
- Group list and settings so they can be enabled/disabled together.
- Make default selection shortcut list. Previous behavior set options
  for the first item, but didn't highlight selection.
- Rename ItemClicked to CurrentItemChanged to reflect correct signal.
2020-02-23 16:08:05 +00:00
Jim Broadus 2179027a6d Prevent global shortcut crash on wayland.
The 3rd party qxt library assumes X11 on linux systems. Don't register
QxtGlobalShortcutBackend when using Wayland.
2020-02-23 16:05:57 +00:00
MorbidMind 60d3435324 Remove obsolete workarounds
Nvidia force close from 2011. Last driver version affected was 304.37, 304.83 is the last in the series and is from 2013.
macOS Soundcloud certificate - CA exists in the system bundle.
macOS font issue from 2013
Gnome volume control with Glib older than 2.36 - Debian Jessie, oldoldstable repo has 2.42
2020-02-23 16:05:26 +00:00
Jim Broadus bb736d1156 Prevent accidental usage of /usr/bin/data
Clementine detects a data directory in the same directory as the executable to
determine portable configuration. But there are some packages that create
/usr/bin/data, causing Clementine to run in portable mode.

Use a more unique data directory name, clementine-data, as the portable data
directory. For backwards compatibility, use the legacy data directory if the
already exists there.
2020-02-23 16:04:42 +00:00
Clementine Buildbot e1c8726661 Automatic merge of translations from Transifex (https://www.transifex.com/projects/p/clementine/resource/clementineplayer) 2020-02-21 10:11:26 +00:00
Jim Broadus 85651dd37f Fix assertion when deleting multiple queued items from playlist.
Removal of items from a playlist is done with a single transaction. When
Queue::SourceLayoutChanged is called after this, the items in the queue are
checked one at a time. When an item is removed, it triggers dataChanged signal
from the model, connected to the SourceDataChanged slot. There, ItemCountChanged
is emitted which calls UpdateTotalLength. This method will assert when it finds
an item that is in the queue, but not in the playlist.

To solve this, disconnect the ItemCountChanged signal at the beginning of
SourceLayoutChanged and re-enable it after cleaning the queue. The method emits
the signal before returning.
2020-02-21 10:09:12 +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
Clementine Buildbot 06ed4a8232 Automatic merge of translations from Transifex (https://www.transifex.com/projects/p/clementine/resource/clementineplayer) 2020-02-17 20:33:23 +00:00
Jim Broadus 9116dfde7d Remove query string that may include auth info. 2020-02-17 20:31:06 +00:00
Jim Broadus 5983ecfac0 Scrub gstreamer error strings for url query strings.
Media URLs may include tokens or other auth info.
2020-02-17 20:31:06 +00:00
Jim Broadus 5dd6d6725a Add a function that scrubs URL queries from strings.
In some cases, URL queries contain auth information. For cases where error
strings are passed from other libraries, such as from gstreamer, add a utility
function, ScrubUrlQueries, to strip queries from URLs in strings.
2020-02-17 20:31:06 +00:00
Jim Broadus a0bb8ab3a1 Replace closures with new Qt functor variant of connect. 2020-02-15 15:00:49 +00:00