Commit Graph

7499 Commits

Author SHA1 Message Date
John Maguire ca6f42fae1 Fix Fedora version for semver 2020-04-11 20:05:07 +01:00
John Maguire 83f38f8df4 Bump to RC2
This might fix Fedora builds
2020-04-11 18:30:40 +01:00
Sophie Tauchert 1d582ba158 Fix songs in dynamic subsonic playlist 2020-04-09 13:49:21 +01:00
John Maguire 06ba555492 Create github prereleases from master 2020-04-02 22:58:35 +01:00
John Maguire d13e0b79d4 Try pushing master builds to github as drafts 2020-04-02 22:05:09 +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
Jim Broadus 902522f4d3 Fix Qt generated log messages.
To avoid infinite recursion, Qt prevents a log generated from an installed
message handler from being handled by that same handler. So when a Qt message
is handled, the logging magic (__logging_message__) that is added by
CreateLogger, and is expected to be detected and stripped by the handler, is
instead dumped to the log.

Instead of sending the Qt messages back through the logging system, use a new
BufferedDebug to build the log message in a buffer, then immeiately print the
buffer to stderr.
2020-03-07 02:41:56 +00:00
Jim Broadus 09723d516c Use a template for CreateLogger to allow different QDebug derivatives. 2020-03-07 02:41:56 +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 79ac16afeb Move unneeded declarations and macros from logging header.
Some functions and macros aren't used outside of logging.cpp and don't need be
declared in header. Functions can be static.
2020-03-06 11:09:20 +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
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 941e139a18 Replace closures with connect variant.
Qt5 introduced new connect variants that allow calling a functor. A lambda can
replace the user of the Closure class in this case.
2020-02-13 19:20:01 +00:00
Jim Broadus b3ec030ae4 Fix songkicks queries.
- When parsing a response, use fromJson instead of fromBinaryData.
  fromBinaryData expects a serialized binary format.
- Calling toString on a non-string JSON value will return an empty
  string. Call toVariant().toString() to do the conversion.
- Add checks for network reply errors.
2020-02-13 19:20:01 +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 52fd6ffadc Add a logging category to log all network requests.
New logging class NetworkRequests disabled by default, but can be enabled with
the command line option.
2020-02-13 11:09:51 +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 415e4aa2ec Don't attempt to resolve URL if not relative. 2020-02-12 09:53:12 +00:00
Jim Broadus e7b0667196 Fix loading songs on portable setup.
QUrl considers a URL relative if it does not include a scheme and QUrl::resolve
will fail if passed a non-relative url. Strip the scheme for the portable cases.

https://doc.qt.io/qt-5/qurl.html#relative-urls-vs-relative-paths
2020-02-12 09:53:12 +00:00
Jim Broadus b9f57c574f Add QString version of GetRelativePathToClementineBin.
Avoid converting paths to and from URLs when calling this function.
2020-02-12 09:53:12 +00:00
Jim Broadus ba4320859d Change LibraryDirectoryModel to take shared backend pointer.
This is mainly for parity amongst the library model classes.
2020-02-11 08:09:22 +00:00
Jim Broadus bc99ff80a9 Move LibraryDirectoryModel out of LibraryModel.
There are several instances of the LibraryModel class used in the system. Each
of these creates a LibraryDirectoryModel instance, but only the instance held
by the main library is every used. Move this out of the LibraryModel class and
into the Library class.
2020-02-11 08:09:22 +00:00