#include <libmythmetadata/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...
|
| |
|
| static int | GetDirectoryId (const QString &directory, int parentid) |
| | Get an ID for the given directory from the database. If it doesn't already exist in the database, insert it. More...
|
| |
| static bool | HasFileChanged (const QString &filename, const QString &date_modified) |
| | Check if file has been modified since given date/time. More...
|
| |
| static void | cleanDB () |
| | Clear orphaned entries from the genre, artist, album and albumart tables. More...
|
| |
| static bool | IsArtFile (const QString &filename) |
| |
| static bool | IsMusicFile (const QString &filename) |
| |
| static void | updateLastRunEnd (void) |
| |
| static void | updateLastRunStart (void) |
| |
| static void | updateLastRunStatus (QString &status) |
| |
Definition at line 12 of file musicfilescanner.h.
◆ MusicLoadedMap
◆ MusicFileLocation
◆ MusicFileScanner()
| MusicFileScanner::MusicFileScanner |
( |
bool |
force = false | ) |
|
|
explicit |
◆ ~MusicFileScanner()
| MusicFileScanner::~MusicFileScanner |
( |
void |
| ) |
|
|
default |
◆ 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 250 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ 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 73 of file musicfilescanner.cpp.
Referenced by BuildFileList(), and SearchDirs().
◆ cleanDB()
| void MusicFileScanner::cleanDB |
( |
| ) |
|
|
staticprivate |
◆ 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 173 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 220 of file musicfilescanner.cpp.
Referenced by ScanMusic().
◆ IsArtFile()
| bool MusicFileScanner::IsArtFile |
( |
const QString & |
filename | ) |
|
|
staticprivate |
◆ IsMusicFile()
| bool MusicFileScanner::IsMusicFile |
( |
const QString & |
filename | ) |
|
|
staticprivate |
◆ IsRunning()
| bool MusicFileScanner::IsRunning |
( |
void |
| ) |
|
|
static |
◆ 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 521 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 866 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 805 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ 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 661 of file musicfilescanner.cpp.
◆ 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 572 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ updateLastRunEnd()
| void MusicFileScanner::updateLastRunEnd |
( |
void |
| ) |
|
|
staticprivate |
◆ updateLastRunStart()
| void MusicFileScanner::updateLastRunStart |
( |
void |
| ) |
|
|
staticprivate |
◆ updateLastRunStatus()
| void MusicFileScanner::updateLastRunStatus |
( |
QString & |
status | ) |
|
|
staticprivate |
◆ m_albumid
| IdCache MusicFileScanner::m_albumid |
|
private |
◆ m_artistid
| IdCache MusicFileScanner::m_artistid |
|
private |
◆ m_coverartAdded
| uint MusicFileScanner::m_coverartAdded {0} |
|
private |
◆ m_coverartRemoved
| uint MusicFileScanner::m_coverartRemoved {0} |
|
private |
◆ m_coverartTotal
| uint MusicFileScanner::m_coverartTotal {0} |
|
private |
◆ m_coverartUnchanged
| uint MusicFileScanner::m_coverartUnchanged {0} |
|
private |
◆ m_coverartUpdated
| uint MusicFileScanner::m_coverartUpdated {0} |
|
private |
◆ m_directoryid
| IdCache MusicFileScanner::m_directoryid |
|
private |
◆ m_forceupdate
| bool MusicFileScanner::m_forceupdate {false} |
|
private |
◆ m_genreid
| IdCache MusicFileScanner::m_genreid |
|
private |
◆ m_startDirs
| QStringList MusicFileScanner::m_startDirs |
|
private |
◆ m_tracksAdded
| uint MusicFileScanner::m_tracksAdded {0} |
|
private |
◆ m_tracksRemoved
| uint MusicFileScanner::m_tracksRemoved {0} |
|
private |
◆ m_tracksTotal
| uint MusicFileScanner::m_tracksTotal {0} |
|
private |
◆ m_tracksUnchanged
| uint MusicFileScanner::m_tracksUnchanged {0} |
|
private |
◆ m_tracksUpdated
| uint MusicFileScanner::m_tracksUpdated {0} |
|
private |
The documentation for this class was generated from the following files: