#include <libmythmetadata/musicfilescanner.h>
|
| 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 |
◆ AddArtworkToDB()
| void MusicFileScanner::AddArtworkToDB |
( |
const QString & |
filename, |
|
|
const QString & |
startDir |
|
) |
| |
|
private |
Insert artwork file details into database.
- Parameters
-
| filename | Full path to file. |
| startDir | The starting directory for the search. This will be removed making the stored name relative to the storage directory where it was found. |
- Returns
- Nothing.
Definition at line 334 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ AddMusicToDB()
| void MusicFileScanner::AddMusicToDB |
( |
const QString & |
filename, |
|
|
const QString & |
startDir |
|
) |
| |
|
private |
Insert music file details into database. Read the metadata and insert that information at the same time.
- Parameters
-
| filename | Full path to file. |
| startDir | The starting directory for the search. This will be removed making the stored name relative to the storage directory where it was found. |
- Returns
- Nothing.
Definition at line 246 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 |
◆ RemoveArtworkFromDB()
| void MusicFileScanner::RemoveArtworkFromDB |
( |
int |
albumartid | ) |
|
|
private |
Removes an artwork file from the database.
- Parameters
-
| albumartid | The albumart_id of the row to delete. |
- Returns
- Nothing.
Definition at line 536 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ RemoveMusicFromDB()
| void MusicFileScanner::RemoveMusicFromDB |
( |
int |
songid | ) |
|
|
private |
Removes a music file from the database.
- Parameters
-
| songid | The song_id of the row to delete. |
- Returns
- Nothing.
Definition at line 518 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ ScanArtwork()
| void MusicFileScanner::ScanArtwork |
( |
MusicLoadedMap & |
art_files, |
|
|
QList< int > & |
albumartidsToDelete |
|
) |
| |
|
private |
Check a list of files against images already in the database.
- Parameters
-
| art_files | MusicLoadedMap |
| albumartidsToDelete | List of albumart_ids in the database that are not present in art_files |
- Returns
- Nothing.
Definition at line 850 of file musicfilescanner.cpp.
Referenced by SearchDirs().
◆ ScanMusic()
| void MusicFileScanner::ScanMusic |
( |
MusicLoadedMap & |
music_files, |
|
|
QList< int > & |
songidsToDelete |
|
) |
| |
|
private |
Check a list of files against music files already in the database.
- Parameters
-
| music_files | MusicLoadedMap |
| songidsToDelete | List of song_ids in the database that are not present in music_files |
- Returns
- Nothing.
Definition at line 787 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 646 of file musicfilescanner.cpp.
◆ updateLastRunEnd()
| void MusicFileScanner::updateLastRunEnd |
( |
void |
| ) |
|
|
staticprivate |
◆ updateLastRunStart()
| void MusicFileScanner::updateLastRunStart |
( |
void |
| ) |
|
|
staticprivate |
◆ updateLastRunStatus()
| void MusicFileScanner::updateLastRunStatus |
( |
QString & |
status | ) |
|
|
staticprivate |
◆ UpdateMusicInDB()
| void MusicFileScanner::UpdateMusicInDB |
( |
const QString & |
filename, |
|
|
const QString & |
startDir |
|
) |
| |
|
private |
Updates a music file in the database.
- Parameters
-
| filename | Full path to file. |
| startDir | The starting directory for 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().
◆ 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: