Commit Graph

72 Commits

Author SHA1 Message Date
Marcus Müller 98e24f626b library: use boolean, not bitwise, operator on bools
Signed-off-by: Marcus Müller <marcus_clementine@baseband.digital>
2023-09-17 12:43:13 +01:00
John Maguire 341dc7326f Reformat all C++ 2020-09-22 14:56:06 +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 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 feaca363a7 Remove directory by id.
Eliminate need to create temporary Directory object when removing a directory.
2020-01-25 18:22:16 -08: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 39934dc302 Fix songs stuck in various artists 2020-01-04 18:27:42 +01:00
Jonas Kvinge 6accd1e3db Fix formatting 2019-11-13 17:39:29 +01:00
Jonas Kvinge 8d75f321de Fix updating compilations 2019-11-13 17:25:54 +01:00
Chocobozzz 16b4f9a991
Merge remote-tracking branch 'upstream/master' into qt5 2018-05-14 08:25:27 +02:00
Jonas Kvinge c9d954f8a3 Fix bug in covermanager not saving album cover to DB. (#6011)
* Fix bug in covermanager not saving album cover to DB.
2018-03-04 14:13:34 +00:00
Chocobozzz 70f68b1926
Merge remote-tracking branch 'upstream/master' into qt5 2018-02-01 09:50:42 +01:00
David Roeca 49876536a5 Resolve #3693 (#5790)
* bring in playlist updates for potential fix

* define signal to handle organise playlist bugs

* work in progress

* fix wrong signal/slot

* next push forward on handling new song creation

* Reorganize signals/slots; still need to figure out why not all signals are being handled

* Get playlists to work when they're in memory

* more changes to playlist updates

* revert unnecessary changes and finalize fix
2017-07-22 18:57:33 +01:00
Chocobozzz fc517ce7a5 Merge remote-tracking branch 'upstream/master' into qt5 2017-06-05 21:28:05 +02:00
santigl a8cbb3b18a Unlock DB mutexes implicitly using scopes. Add error handling for query. 2017-03-06 18:21:27 +00:00
santigl deb7c33c64 Add support for 'album artist' field in the LibraryBackendInterface 2017-03-06 18:21:27 +00:00
santigl 62cec8cf28 Prioritize album artist in cover search and manager 2017-03-06 18:21:27 +00:00
Chocobozzz 8b226c2171 Update non optionnals sources to qt5 2015-04-11 23:24:07 +02:00
David Sansome f6a72828a9 Write statistics and ratings in Library, not LibraryBackend. 2014-06-07 15:19:43 +10:00
Joseph Freeman fe4a80b2d5 Removed commented-out code and ran make format. 2014-04-25 19:41:04 -04:00
Joseph Freeman 156728390d Increase performance of mass rating changes. 2014-04-25 19:37:46 -04:00
John Maguire 3323c2d094 Convert all instances of foreach() to a C++11 for
find ext src -name '*.cpp' -exec \
    sed -i -e 's/foreach(\([^,]\+\),/for (\1 :/' {} \;
2014-02-10 14:43:32 +01:00
John Maguire bebd781fdf Reformat all non-3rd-party C/C++/Objective-C++.
Command line:
find src ext -regex '.*\.\(h\|cpp\|mm\)' -exec clang-format -i
 -style='{BasedOnStyle: Google, DerivePointerBinding: false}' {} \;
2014-02-07 16:34:20 +01:00
Gregor Tätzner 0cab75b28f removed useless debug log 2014-02-06 19:27:36 +01:00
Gregor Tätzner 7317b6792e don't rescan unchanged files if library has been unavailable 2014-02-01 20:21:28 +01:00
Andreas 98dd001a4f Further work on portable version. 2013-10-03 17:08:42 +02:00
Andreas acb18cdcde First tries on a portable version. 2013-09-29 10:43:34 +02:00
Arnaud Bienner 88918d45c5 Update issue 1175:
Save rating and statistics in two distinct ways, and let users activate them separately in preferences.
2013-03-30 23:42:29 +01:00
Arnaud Bienner db5fbe2059 Update issue 1175:
Add an option in preferences to save all ratings/statistics into files, for all songs
2013-03-26 23:56:46 +01:00
Arnaud Bienner b157c307e7 Add preference to save ratings and statistics in files 2013-02-24 18:36:37 +01:00
Arnaud Bienner 08d40f5fca Handle statistics tags apart, and write them to file when they change.
Next step: add a preference to activate this (should be deactivated by default IMO).
2013-02-24 17:45:25 +01:00
Tony Motakis 207225d620 HasCompilations() implementation local to the LibraryModel
Instead of relying on the backend to provide us with the information
of whether there are compilations in the whole of the library, we instead
look into the query we are currently working with for compilations. This
way we can be as granular as we want in the future.

This also means we now have to add the Various artists node at the time we
do the query with RunQuery() instead at BeginReset().
2012-10-27 16:30:08 -07:00
David Sansome 48f15c9fc7 Refactoring: instead of passing individual pointers to useful core classes (like TaskManager or LibraryBackend) to each class that uses them, pass one singleton-like Application instance everywhere. 2012-02-26 14:40:51 +00:00
Angus Gratton f33d9b82d4 Prompt user if they are adding one part of a larger compilation to Various Artists. Fixes issue 2725 2012-02-19 13:55:30 +00:00
Angus Gratton c5c581a4f1 Autodetect compilations based on effective_albumartist not artist (Fixes issue 509) 2011-11-28 11:04:38 +00:00
Angus Gratton 2cf6875c6d Fix bug caused by adding Various Artists for albumartist, where nodes would sometimes not move under Various Artists due to album node never being empty (Issue 509) 2011-11-28 11:04:38 +00:00
David Sansome e6b2e5bcae Make the DeleteSongs function actually delete songs again, and make a new MarkUnavailable function that is called when songs are deleted from disk (and stop it from removing the song from the search index). 2011-07-06 20:07:56 +00:00
David Sansome 7415d85dce When initialising a song from a library query, don't always assume the metadata originally came from a file (which means icycast tags are ignored when it is played). Fixes issue 1857 2011-06-17 20:00:10 +00:00
David Sansome 792352be3b When songs disappear from the filesystem (either they're deleted or are on a removable media that was unmounted), mark them as unavailable instead of removing them from the database. Thanks google@robbertkrebbers.nl. Fixes issue 401 2011-05-14 13:43:57 +00:00
David Sansome ccb9f8cf94 Use URLs everywhere instead of filenames. Move the URL parsing and song loading code out of individual playlist parsers and into the base class. Fix the playlist parser unit tests. 2011-04-28 12:27:53 +00:00
David Sansome 002ae13817 Use the canonical file path (resolve symlinks and '..') when adding directories to the library, and when adding files to the playlist. Fixes issue #1494 2011-03-13 14:43:03 +00:00
David Sansome 507c5e2632 Change the fields in Song from seconds to nanoseconds 2011-02-13 18:34:30 +00:00
Paweł Bara 9a9d8ad177 don't let invalid CUE related media files into library (invalid == those which were not recognized by TagLib)
better logging of erroneous DB queries (error + query + bound values instead of just error)
2011-02-05 13:43:04 +00:00
Paweł Bara ddd3f119d3 CUE songs are now properly updated in library - you can delete a CUE sheet, add it, you can change section markers in it etc. and everything should work as expected
Song now knows it's cue path (if any)
2011-01-15 18:46:23 +00:00
Paweł Bara 4f7e804638 library: watcher now updates CUE associated songs + ignores the not-CUE-associated songs in a CUE sheet
CueParser: properly update length for the last song from every FILE in multifile CUE sheet
new 'playlist_path' argument in the 'Load' part of PlaylistParser's API
2011-01-11 23:09:59 +00:00
David Sansome 9b82ecbb72 Add tag completers for albumartist, composer and genre, and load completion models in background threads 2010-12-25 13:11:09 +00:00
David Sansome 8cdce2767b Implement the reset play counts button 2010-12-25 11:54:21 +00:00
David Sansome 69d3d89b0f Have a different list of smart playlists for Jamendo and the normal Library. Only add default Jamendo smart playlists once. 2010-11-27 17:52:08 +00:00
David Sansome b85ddbb380 Put the Jamendo songs in a separate database that gets attached to the main database. "Reload" it by deleting the file, which is much faster than DELETEing all the songs inside. Make reloading the Jamendo, Icecast and Magnatune databases always bypass the network cache. Store the Jamendo track IDs in a separate table - for some reason this makes inserts faster. Fix the Jamendo model after the inital database load. Make the Jamendo dymanic playlist use the entries that are already in the local database rather than fetching the song metadata again. 2010-11-27 16:14:09 +00:00