mirror of
https://github.com/rembo10/headphones.git
synced 2026-05-16 08:35:32 +01:00
Forcing legacy (comprehensive) updates now nukes data tables, which unintuitively makes the process go MUCH faster.
This commit is contained in:
@@ -146,11 +146,17 @@
|
||||
<div id="tabs-4" class="configtable">
|
||||
<fieldset>
|
||||
<legend>Force Legacy</legend>
|
||||
<p><strong>Comprehensive Updating</strong></p>
|
||||
<p>Please note that these functions will take a significant amount of time to complete.</p>
|
||||
<BR>
|
||||
<div class="links">
|
||||
<a href="#" onclick="doAjaxCall('forceFullUpdate',$(this))" data-success="Update active artists successful" data-error="Error forcing update artists"><span class="ui-icon ui-icon-heart"></span>Force Update Active Artists [Comprehensive]</a>
|
||||
<a href="#" onclick="doAjaxCall('forceScan',$(this))" data-success="Library scan successful" data-error="Error forcing library scan"><span class="ui-icon ui-icon-refresh"></span>Force Re-scan Library [Comprehensive]</a>
|
||||
<a href="#" onclick="doAjaxCall('forceFullUpdate',$(this))" data-success="Update active artists successful" data-error="Error forcing update artists"><span class="ui-icon ui-icon-heart"></span>Force Update Active Artists [Comprehensive]</a>
|
||||
<BR>
|
||||
<small>*Warning: If you choose [Force Update Active Artists], artist "extras" will be reset, manual album release matching will be reset, "paused" artists will lose ALL information, and "wanted" albums will be reset to include only recent/future albums. It's recommended you activate all paused artists before running.</small>
|
||||
<BR><BR>
|
||||
<a href="#" onclick="doAjaxCall('forceScan',$(this))" data-success="Library scan successful" data-error="Error forcing library scan"><span class="ui-icon ui-icon-refresh"></span>Force Re-scan Library [Comprehensive]</a>
|
||||
<BR>
|
||||
<small>*Warning: If you choose [Force Re-scan Library], any manually ignored/matched artists/albums will be reset to "unmatched".</small>
|
||||
|
||||
</div>
|
||||
</fieldset>
|
||||
|
||||
|
||||
@@ -19,11 +19,21 @@ from headphones import logger, db, importer
|
||||
|
||||
def dbUpdate(forcefull=False):
|
||||
|
||||
logger.info('Starting update for %i active artists' % len(activeartists))
|
||||
|
||||
myDB = db.DBConnection()
|
||||
|
||||
activeartists = myDB.select('SELECT ArtistID, ArtistName from artists WHERE Status="Active" or Status="Loading" order by LastUpdated ASC')
|
||||
#This can be updated to NOT include: paused artists, artists with extras enabled, wanted albums, albums matched to specific releases, etc
|
||||
#But it absolutely FLIES if these dB's are destroyed in their entirety. With the new system, there's really no need to pause artists.
|
||||
if forcefull==True:
|
||||
myDB.select('DELETE from albums')
|
||||
myDB.select('DELETE from allalbums')
|
||||
myDB.select('DELETE from tracks')
|
||||
myDB.select('DELETE from alltracks')
|
||||
myDB.select('DELETE from descriptions')
|
||||
myDB.select('UPDATE artists SET LatestAlbum=?, ReleaseDate=?, AlbumID=?, HaveTracks=?, TotalTracks=?', [None, None, None, None, None])
|
||||
|
||||
logger.info('Starting update for %i active artists' % len(activeartists))
|
||||
activeartists = myDB.select('SELECT ArtistID, ArtistName from artists WHERE Status="Active" or Status="Loading" order by LastUpdated ASC')
|
||||
|
||||
for artist in activeartists:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user