Commit Graph

403 Commits

Author SHA1 Message Date
Jonas Kvinge f596695f61 CollectionModel: Don't process model updates when loading 2024-06-14 18:40:52 +02:00
Jonas Kvinge 5451c110b1 Replace QStringLiteral with QLatin1String 2024-06-12 20:30:36 +02:00
Jonas Kvinge 57fb52e8f0 Add LL 2024-06-12 18:11:43 +02:00
Jonas Kvinge a36bf2df65 Replace QStringLiteral with QLatin1String 2024-06-12 18:08:54 +02:00
Jonas Kvinge f5002cae36 Make static 2024-06-12 18:07:58 +02:00
Jonas Kvinge 05358cdfe4 Add default to switch 2024-06-12 17:41:17 +02:00
Jonas Kvinge 7b43a94055 CollectionBackend: Use static `QMetaObject::invokeMethod` 2024-06-12 17:40:08 +02:00
Jonas Kvinge b233600b8c Remove useless else 2024-06-12 17:38:58 +02:00
Jonas Kvinge b89c200076 Replace QStringLiteral with QLatin1String 2024-06-12 02:13:27 +02:00
Jonas Kvinge 597a8cd6c8 Remove QStringBuilder include 2024-06-12 00:44:48 +02:00
Jonas Kvinge e477449cd4 Rewrite collection model and search
Fixes #392
2024-06-11 23:18:38 +02:00
Jonas Kvinge 6e90e72b4a CollectionModel: Add content to fake header for pixmap cache
QNetworkCacheMetaData requires this now.
2024-05-26 02:49:26 +02:00
Jonas Kvinge 76614bcde0 Only apply collection directories changes on save 2024-05-12 21:40:51 +02:00
Jonas Kvinge 426de61525 Add const and std::as_const 2024-04-23 17:15:42 +02:00
Jonas Kvinge 9c92ef941f CollectionModel: Remove redundant const_cast 2024-04-23 16:52:17 +02:00
Jonas Kvinge 7aefe3d71b Change QList<QString> to QStringList 2024-04-23 16:51:42 +02:00
Jonas Kvinge 398db964b8 Use QDateTime::currentSecsSinceEpoch 2024-04-23 16:48:51 +02:00
Jonas Kvinge 569bf6335b CollectionView: Add action_search_for_this_ to initialization list 2024-04-23 01:57:16 +02:00
Jonas Kvinge df070ac0cf Optimize `Song::InitFromQuery`
Use `QSqlQuery::value(int)` or `QSqlRecord::value(int)` instead of `QSqlQuery::value(QString)`.
Make `SqlRow` use `QSqlRecord` directly instead iterating over all columns.
2024-04-21 15:42:29 +02:00
Jonas Kvinge 7b88be2635 CollectionModel: Only set grouping if it's selected 2024-04-21 15:42:29 +02:00
Jonas Kvinge 0c6872b352 Disable automatic conversions from 8-bit strings 2024-04-13 05:05:33 +02:00
Jonas Kvinge 58944993b8 Use QStringLiteral 2024-04-09 23:20:26 +02:00
Jonas Kvinge e1fbe9ae54 Resolve song from collection using track with Cue in XSPF
Fixes #1181
2024-04-04 22:22:02 +02:00
Jonas Kvinge 4c1a5168f0 CollectionModel: Reset model before deletion 2024-04-03 21:17:20 +02:00
Sami Boukortt 2aa70b6ab8 Add an option not to skip “The” when sorting artist names 2024-03-11 23:34:42 +01:00
Jonas Kvinge 7f4c61b15a Improve album and title disc, remastered, etc matching
Don't partial remove things like "(Mono / Remastered)".

Fixes #1387
2024-03-02 19:48:19 +01:00
Jonas Kvinge 72bccad82d Add accessible name for QToolButton css
Make sure it does not apply to other buttons.

Fixes #1255
2024-02-25 02:50:40 +01:00
Jacob Henner fa057ee9d3 CollectionView: Add "search for this"
Add selection search in the collection view, to allow users to quickly
search for similarly-named songs, artists, albums, etc.
2024-01-25 19:16:14 +01:00
Jonas Kvinge f901f802bb CollectionView: Implement add to playlist with enter
Fixes #1360
2024-01-19 23:04:03 +01:00
Jonas Kvinge 04e593dc62 CollectionWatcher: Add unavailable song restored logging 2024-01-03 00:45:30 +01:00
Jonas Kvinge 2294c38aa9 CollectionBackend: Rename SqlQuery variable 2024-01-03 00:44:54 +01:00
Jonas Kvinge d96d4224a2 Collection: Use normal pointer for watcher
Fixes #1316
2023-11-29 22:26:40 +01:00
Jonas Kvinge 310b7b9065 CollectionQuery: Add F for float 2023-10-14 22:08:50 +02:00
Jonas Kvinge 89d2a23dac CollectionBackend: Use QString::arg() 2023-10-13 23:06:29 +02:00
Jonas Kvinge 13ac20f8b3 Add/remove reference for parameters 2023-10-13 22:58:18 +02:00
Jonas Kvinge 1493164df9 CollectionQuery: Strip off whitespaces after colon and simplify code
Fixes #1290
2023-10-10 19:15:20 +02:00
Jonas Kvinge 79c69e1b1e CollectionWatcher: Match extension case-insensitive 2023-10-02 17:39:10 +02:00
Jonas Kvinge 8fc95e08dc CollectionWatcher: Ignore compressed files
Fixes #1274
2023-10-02 17:23:47 +02:00
Jonas Kvinge cdb4980337 CollectionBackend: Don't expire unavailable songs part of playlists 2023-09-17 21:54:27 +02:00
Dakes 7aa7cdf6f3 Add filtering of numerical cols to collection
CollectionFilterWidget: Updated the tooltip, to reflect the changes.
CollectionQuery: Add parsing for SQL operators and insert right SQL
"where" searches.
Song: Add list of numerical columns
playlistfilterparser.cpp/FilterParser: move time and rating parsing
functions to new file:
searchparserutils.cpp: Contains common code used to parse search terms
in playlist and collection filters.
2023-08-02 16:52:27 +02:00
Jonas Kvinge b55a0df8e1 CollectionView: Remove useless variable 2023-07-21 07:15:42 +02:00
Jonas Kvinge 75ab6f25f4 Check return of QSqlQuery::prepare 2023-07-21 07:12:20 +02:00
Jonas Kvinge eaed82c9b2 CollectionItemDelegate: Remove check for nullptr, already done 2023-07-21 07:11:21 +02:00
Jonas Kvinge 2e61235403 Application: Use shared pointers
Fixes #1239
2023-07-21 05:55:24 +02:00
Jonas Kvinge d6b53f78ab Cleanup includes 2023-07-21 05:25:57 +02:00
Jonas Kvinge a2c7ff63df Formatting 2023-07-21 05:11:27 +02:00
Jonas Kvinge 3d25863ccb CollectionWatcher: Make PerformEBUR128Analysis const 2023-07-12 16:22:17 +02:00
Roman Lebedev bda2b91c92 Collectionwatcher: sink `PerformEBUR128Analysis()` into `ScanNewFile` & friends 2023-07-12 14:34:04 +02:00
Roman Lebedev 1462bfa297 CollectionWatcher: support EBU R 128 analysis
Again, somewhat pretty similar to the existing fingerprint analysis,
we must support performing it both for the new files,
and re-performing it on (some of) already-existing songs,
because it might have been disabled before.

Admittedly, i quite don't like some of this code,
maybe this can be done in a more concise way.

NOTE: this only supports scanning each separate songs.
Should we ever want to support per-album loudness normalization,
this will need massive changes...
2023-07-12 14:34:04 +02:00
Roman Lebedev f905676b1c CollectionBackend/CollectionWatcher: add `HasSongsWithMissingLoudnessCharacteristics` logic
Exactly identical to the "missing fingerprint" logic,
just for the two new fields being added.
2023-07-12 14:34:04 +02:00
Jonas Kvinge 6d55eb5974 CollectionModel: Fix icon disk cache 2023-06-07 00:51:53 +02:00
Jonas Kvinge be6f93735d Simplify if statements 2023-06-06 23:19:45 +02:00
Jonas Kvinge 331aa382f9 Rewrite album cover loader 2023-06-06 20:41:01 +02:00
Jonas Kvinge 2f17647cd3 Use const reference for AlbumCoverLoaderResult 2023-05-03 21:43:22 +02:00
Jonas Kvinge e511b2faf9 Use new connect syntax for QMetaObject::invokeMethod 2023-05-03 20:08:51 +02:00
Jonas Kvinge 84e7cd0df8 CollectionWatcher: Connect PathChanged signal once 2023-05-03 01:17:10 +02:00
Jonas Kvinge b0b8ff2d49 CollectionModel: URL percent encode disk cache keys
Fixes #1183
2023-04-18 18:42:37 +02:00
Jonas Kvinge aaa530e72b Add const/references to all signal parameters 2023-04-09 20:23:42 +02:00
Jonas Kvinge fa856ee905 Remove directory.h 2023-04-09 20:17:45 +02:00
Jonas Kvinge f1a3a12c1c CollectionBackend: Fix SQL query error message 2023-04-07 20:54:15 +02:00
Jonas Kvinge b660287779 Use `std::shared_ptr`for `AlbumCoverLoaderResult`
Reduces memory fragmentation with Qt 6
2023-04-06 23:18:10 +02:00
Jonas Kvinge 962536bc83 AlbumCoverLoaderResult: Use enum class for type 2023-04-06 01:23:42 +02:00
Jonas Kvinge ffe6a81b9a Collection: Always use Idle priority for watcher 2023-03-26 00:10:29 +01:00
Jonas Kvinge 0604c78453 CollectionBackend: Check for changed fingerprint 2023-03-25 18:35:14 +01:00
Jonas Kvinge c8169adf7c CollectionModel: Guard against invalid disc and year 2023-03-25 18:32:41 +01:00
Jonas Kvinge 7b610d131c CollectionModel: Replace qMax with std::max 2023-03-25 18:31:21 +01:00
Jonas Kvinge 2aeab8b672 CollectionModel: Remove unused QByteArray include 2023-03-25 18:26:53 +01:00
Jonas Kvinge b02ac833ad CollectionWatcher: Fix rescan songs feature 2023-03-25 16:38:03 +01:00
Jonas Kvinge ed260c6e20 CollectionWatcher: Check for changed AcoustID and MusicBrainz 2023-03-25 14:35:12 +01:00
Jonas Kvinge e20cbe4170 Save embedded cover in the same process as tags
Possible fix for #1158
2023-03-18 20:03:07 +01:00
Jonas Kvinge 01f8d0a27e SavedGroupingManager: Add missing collectionsettingspage include 2023-03-18 01:01:28 +01:00
Jonas Kvinge 39e1bfc84f CollectionBackend: Add default for ResetStatistics save_tags to false 2023-03-18 01:00:28 +01:00
Jonas Kvinge e394416fa7 CollectionFilterWidget: Add missing collectionsettingspage include 2023-03-18 00:59:39 +01:00
Jonas Kvinge 5431307527 CollectionFilterOptions: Match album artist too 2023-02-18 17:05:41 +01:00
Jonas Kvinge 79bf194ed6 CollectionModel: Fix compilation requirement query
Fixes #1140
2023-02-18 16:40:12 +01:00
Jonas Kvinge dd72fb4ca5 Use C++11 enum class 2023-02-18 14:09:30 +01:00
Jonas Kvinge a5c1f4b0ee EditTagDialog: Fix saving play statistics
Fixes #1124
2023-02-10 22:51:48 +01:00
Jonas Kvinge b5fa401db9 Collection: Make sure `RunQuery` does not access collection items
- Rename `QueryOptions` to `CollectionFilterOptions`.
- Create new class `CollectionQueryOptions` for passing options from model to `CollectionQuery`.
- Rename `Directory` to `CollectionDirectory`.

Fixes #1095
2023-01-08 18:16:16 +01:00
Jonas Kvinge cc4a99ad80 CollectionModel: Close database with same mutex 2023-01-07 23:57:23 +01:00
Jonas Kvinge e97be5850b CollectionModel: Change while to for loop 2023-01-07 23:26:36 +01:00
Jonas Kvinge 2c302654b7 CollectionBackendInterface: Initialize filetype 2023-01-07 23:19:37 +01:00
Jonas Kvinge 205b7f2401 Split utilities functions into separate files 2022-12-28 22:53:59 +01:00
Jonas Kvinge 26d3e8371f CollectionWatcher: Only run periodic scan when monitoring is on 2022-10-29 19:12:04 +02:00
Jonas Kvinge 99d963b99c MusicStorage: Add source 2022-10-19 18:36:33 +02:00
Jonas Kvinge 54fc11a235 CollectionBackend: Rename source accessor 2022-10-19 17:11:56 +02:00
Jonas Kvinge b22320c48f Replace typedef with using 2022-10-13 22:39:31 +02:00
Jonas Kvinge 2b24ac54a0 Remove unused includes 2022-08-28 03:09:33 +02:00
Jonas Kvinge 6bc46e4598 CollectionModel: Make `separate_albums_by_grouping` optional 2022-08-20 16:47:09 +02:00
Jonas Kvinge 6562258db5 CollectionModel: Make separating albums by grouping optional
Fixes #1018
2022-08-20 14:51:19 +02:00
Jonas Kvinge 98682a2da9 Use C++17 fallthrough 2022-07-26 20:37:06 +02:00
Jonas Kvinge d82fd421ed Replace use of C-style casts 2022-06-13 00:23:42 +02:00
Jonas Kvinge 6c0b395f4a Add option for overwriting playcounts
Fixes #962
2022-06-05 04:59:50 +02:00
Jonas Kvinge 3c8d0ebd52 CollectionModel: Use grouping in all album groupings 2022-05-31 00:53:47 +02:00
Jonas Kvinge a2dad982f8 Move sqlrow to core 2022-05-13 18:15:04 +02:00
Jonas Kvinge f6b70fda71 Formatting 2022-03-22 21:09:05 +01:00
Jonas Kvinge fc35d2a35c Collection: Add I/O priority and thread priority to initialization list 2022-02-06 04:14:02 +01:00
Jonas Kvinge 53d5192477 Allow deleting CUE songs 2022-02-05 15:56:18 +01:00
Jonas Kvinge e31c9d74fa Add advanced settings for configuring collection watcher 2022-01-30 04:24:33 +01:00
Jonas Kvinge 0dbf3b462b CollectionWatcher: Remove broken nomedia/nomusic handling
It causes songs to be stuck when adding a nomedia file to an existing
directory.
2022-01-28 23:56:10 +01:00
Jonas Kvinge cd9f8b569b CollectionWatcher: Ignore temp files 2022-01-28 23:53:58 +01:00