#include <musicfilescanner.h>
|
void | BuildFileList (QString &directory, MusicLoadedMap &music_files, MusicLoadedMap &art_files, int parentid) |
| Builds a list of all the files found descending recursively into the given directory. More...
|
|
void | AddFileToDB (const QString &filename, const QString &startDir) |
| Insert file details into database. If it is an audio file, read the metadata and insert that information at the same time. More...
|
|
void | RemoveFileFromDB (const QString &filename, const QString &startDir) |
| Removes a file from the database. More...
|
|
void | UpdateFileInDB (const QString &filename, const QString &startDir) |
| Updates a file in the database. More...
|
|
void | ScanMusic (MusicLoadedMap &music_files) |
| Check a list of files against musics files already in the database. More...
|
|
void | ScanArtwork (MusicLoadedMap &music_files) |
| Check a list of files against images already in the database. More...
|
|
Definition at line 12 of file musicfilescanner.h.
◆ MusicLoadedMap
◆ MusicFileLocation
◆ MusicFileScanner()
MusicFileScanner::MusicFileScanner |
( |
bool |
force = false | ) |
|
|
explicit |
◆ ~MusicFileScanner()
MusicFileScanner::~MusicFileScanner |
( |
void |
| ) |
|
|
default |
◆ SearchDirs()
void MusicFileScanner::SearchDirs |
( |
const QStringList & |
dirList | ) |
|
Scan a list of directories recursively for music and albumart. Inserts, updates and removes any files any files found in the database.
- Parameters
-
dirList | List of directories to scan |
- Returns
- Nothing.
Definition at line 646 of file musicfilescanner.cpp.
◆ IsRunning()
bool MusicFileScanner::IsRunning |
( |
void |
| ) |
|
|
static |
◆ BuildFileList()
Builds a list of all the files found descending recursively into the given directory.
- Parameters
-
directory | Directory to begin search |
music_files | A pointer to the MusicLoadedMap to store the results |
art_files | A pointer to the MusicLoadedMap to store the results |
parentid | The id of the parent directory in the music_directories table. The root directory should have an id of 0 |
- Returns
- Nothing.
Definition at line 74 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ GetDirectoryId()
int MusicFileScanner::GetDirectoryId |
( |
const QString & |
directory, |
|
|
int |
parentid |
|
) |
| |
|
staticprivate |
Get an ID for the given directory from the database. If it doesn't already exist in the database, insert it.
- Parameters
-
directory | Relative path to directory, from base dir |
parentid | The id of the parent directory in the music_directories table. The root directory should have an id of 0 |
- Returns
- Directory id
Definition at line 174 of file musicfilescanner.cpp.
Referenced by BuildFileList().
◆ HasFileChanged()
bool MusicFileScanner::HasFileChanged |
( |
const QString & |
filename, |
|
|
const QString & |
date_modified |
|
) |
| |
|
staticprivate |
Check if file has been modified since given date/time.
- Parameters
-
filename | File to examine |
date_modified | Date to use in comparison |
- Returns
- True if file has been modified, otherwise false
Definition at line 221 of file musicfilescanner.cpp.
Referenced by ScanMusic().
◆ AddFileToDB()
void MusicFileScanner::AddFileToDB |
( |
const QString & |
filename, |
|
|
const QString & |
startDir |
|
) |
| |
|
private |
Insert file details into database. If it is an audio file, read the metadata and insert that information at the same time.
If it is an image file, just insert the filename and type.
- Parameters
-
filename | Full path to file. |
startDir | The starting directory fir the search. This will be removed making the stored name relative to the storage directory where it was found. |
- Returns
- Nothing.
Definition at line 251 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ RemoveFileFromDB()
void MusicFileScanner::RemoveFileFromDB |
( |
const QString & |
filename, |
|
|
const QString & |
startDir |
|
) |
| |
|
private |
Removes a file from the database.
- Parameters
-
filename | Full path to file. |
startDir | The starting directory fir the search. This will be removed making the stored name relative to the storage directory where it was found. |
- Returns
- Nothing.
Definition at line 506 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ UpdateFileInDB()
void MusicFileScanner::UpdateFileInDB |
( |
const QString & |
filename, |
|
|
const QString & |
startDir |
|
) |
| |
|
private |
Updates a file in the database.
- Parameters
-
filename | Full path to file. |
startDir | The starting directory fir the search. This will be removed making the stored name relative to the storage directory where it was found. |
- Returns
- Nothing.
Definition at line 557 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ ScanMusic()
Check a list of files against musics files already in the database.
- Parameters
-
music_files | MusicLoadedMap |
- Returns
- Nothing.
Definition at line 782 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ ScanArtwork()
Check a list of files against images already in the database.
- Parameters
-
music_files | MusicLoadedMap |
- Returns
- Nothing.
Definition at line 838 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ cleanDB()
void MusicFileScanner::cleanDB |
( |
| ) |
|
|
staticprivate |
◆ IsArtFile()
bool MusicFileScanner::IsArtFile |
( |
const QString & |
filename | ) |
|
|
staticprivate |
◆ IsMusicFile()
bool MusicFileScanner::IsMusicFile |
( |
const QString & |
filename | ) |
|
|
staticprivate |
◆ updateLastRunEnd()
void MusicFileScanner::updateLastRunEnd |
( |
void |
| ) |
|
|
staticprivate |
◆ updateLastRunStart()
void MusicFileScanner::updateLastRunStart |
( |
void |
| ) |
|
|
staticprivate |
◆ updateLastRunStatus()
void MusicFileScanner::updateLastRunStatus |
( |
QString & |
status | ) |
|
|
staticprivate |
◆ m_startDirs
QStringList MusicFileScanner::m_startDirs |
|
private |
◆ m_directoryid
IdCache MusicFileScanner::m_directoryid |
|
private |
◆ m_artistid
IdCache MusicFileScanner::m_artistid |
|
private |
◆ m_genreid
IdCache MusicFileScanner::m_genreid |
|
private |
◆ m_albumid
IdCache MusicFileScanner::m_albumid |
|
private |
◆ m_tracksTotal
uint MusicFileScanner::m_tracksTotal {0} |
|
private |
◆ m_tracksUnchanged
uint MusicFileScanner::m_tracksUnchanged {0} |
|
private |
◆ m_tracksAdded
uint MusicFileScanner::m_tracksAdded {0} |
|
private |
◆ m_tracksRemoved
uint MusicFileScanner::m_tracksRemoved {0} |
|
private |
◆ m_tracksUpdated
uint MusicFileScanner::m_tracksUpdated {0} |
|
private |
◆ m_coverartTotal
uint MusicFileScanner::m_coverartTotal {0} |
|
private |
◆ m_coverartUnchanged
uint MusicFileScanner::m_coverartUnchanged {0} |
|
private |
◆ m_coverartAdded
uint MusicFileScanner::m_coverartAdded {0} |
|
private |
◆ m_coverartRemoved
uint MusicFileScanner::m_coverartRemoved {0} |
|
private |
◆ m_coverartUpdated
uint MusicFileScanner::m_coverartUpdated {0} |
|
private |
◆ m_forceupdate
The documentation for this class was generated from the following files: