Sayonara Player
Albums.h
1 /* DatabaseAlbums.h */
2 
3 /* Copyright (C) 2011-2019 Lucio Carreras
4  *
5  * This file is part of sayonara player
6  *
7  * This program is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11 
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16 
17  * You should have received a copy of the GNU General Public License
18  * along with this program. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef DATABASEALBUMS_H
22 #define DATABASEALBUMS_H
23 
24 #include "Database/SearchableModule.h"
25 
26 namespace Library {class Filter;}
27 class Album;
28 class AlbumList;
29 
30 namespace DB
31 {
32  class Albums :
33  private SearchableModule
34  {
35  PIMPL(Albums)
36 
37  public:
38  Albums(const QString& connection_name, DbId db_id, LibraryId library_id);
39  ~Albums();
40 
41  virtual bool db_fetch_albums(Query& q, AlbumList& result) const;
42 
43  virtual AlbumId getAlbumID (const QString& album) const;
44 
45  virtual bool getAlbumByID(AlbumId id, Album& album) const;
46  virtual bool getAlbumByID(AlbumId id, Album& album, bool also_empty) const;
47 
48  virtual bool getAllAlbums(AlbumList& result, bool also_empty) const;
49  virtual bool getAllAlbumsByArtist(const IdList& artists, AlbumList& result, const ::Library::Filter& filter) const;
50 
51  virtual bool getAllAlbumsBySearchString(const ::Library::Filter& filter, AlbumList& result) const;
52 
53  virtual AlbumId insertAlbumIntoDatabase (const QString& album);
54  virtual AlbumId insertAlbumIntoDatabase (const Album& album);
55 
56  virtual AlbumId updateAlbumRating(AlbumId id, Rating rating);
57 
58  virtual void updateAlbumCissearch();
59 
60  protected:
61  virtual QString artistid_field() const=0;
62 
63  private:
64  virtual QString fetch_query_albums(bool also_empty) const;
65  };
66 }
67 
68 #endif // DATABASEALBUMS_H
Definition: Query.h:35
Definition: SearchableModule.h:32
The AlbumList class.
Definition: Album.h:89
The Album class.
Definition: Album.h:39
Definition: Albums.h:32
An interface class needed when implementing a library plugin.
Definition: LocalLibraryWatcher.h:32
Definition: EngineUtils.h:33