Bug 138029 - collection update slows system down extremely
Summary: collection update slows system down extremely
Status: RESOLVED WORKSFORME
Alias: None
Product: amarok
Classification: Unclassified
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE RPMs Linux
: NOR wishlist (vote)
Target Milestone: ---
Assignee: Amarok Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-11-28 16:26 UTC by Ron Eggler
Modified: 2006-12-01 17:00 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Ron Eggler 2006-11-28 16:26:34 UTC
Version:           1.4-SVN-0611251723 (using KDE KDE 3.5.5)
Installed from:    SuSE RPMs
Compiler:          gcc 4.1.0 
OS:                Linux

Hi,

I think it would be very nice if you could set the update interval, how often amarok should check in folders for change since i do have a pretty big collection ounted on an smb share (100mbit) and it seems to be updating my collection all the time which is kinda annoying cause it slows down the whole systtem extremely.
Thank you for taking care!

roN
Comment 1 Mark Kretschmann 2006-11-28 18:35:40 UTC
Just disable "Watch folders for changes". Then you can trigger updates manually.
Comment 2 Ron Eggler 2006-11-29 03:39:45 UTC
how do i trigger 'em? Is there a button that is offerning this function or is it doing it unconditionally when it starts?
Wouldn't it be nice to have an option like "Don't update library on start" To get it started-up faster...?
Thanks!
roN
Comment 3 Tobias Knieper 2006-11-29 10:10:29 UTC
You can trigger it by pressing the "Scan changes" button in collection browser.
Comment 4 Ron Eggler 2006-11-29 16:49:57 UTC
There is no button in my version :O What version are you running?
Comment 5 Mark Kretschmann 2006-11-29 17:50:32 UTC
Again: Disable "Watch folders for changes". Then the button will appear.
Comment 6 Ron Eggler 2006-11-30 03:08:27 UTC
Wrong, the checkbox is unchecked but there's still no button... :o a bug?
Comment 7 Mark Kretschmann 2006-11-30 09:05:54 UTC
Yeah, that's a bug.
Comment 8 Mark Kretschmann 2006-11-30 09:06:57 UTC
It works after a restart.
Comment 9 Mark Kretschmann 2006-11-30 10:40:40 UTC
SVN commit 609337 by markey:

Solve the usability nightmare that has been the "Scan Changes" button in the collection browser. This button is no more. Instead, I created a permanently active entry "Update Collection" in the main menu.

I think this is less confusing than conditionally showing this button or not. And also it's sometimes handy to start a update scan immediately.

CCBUG: 138029


 M  +2 -0      actionclasses.cpp  
 M  +2 -14     collectionbrowser.cpp  
 M  +0 -1      collectionbrowser.h  
 M  +3 -0      playlistwindow.cpp  


--- trunk/extragear/multimedia/amarok/src/actionclasses.cpp #609336:609337
@@ -126,6 +126,8 @@
 
     insertSeparator();
 
+
+    safePlug( ac, "update_collection", this );
     insertItem( SmallIconSet( Amarok::icon( "rescan" ) ), i18n("&Rescan Collection"), ID_RESCAN_COLLECTION );
     setItemEnabled( ID_RESCAN_COLLECTION, !ThreadWeaver::instance()->isJobPending( "CollectionScanner" ) );
 
--- trunk/extragear/multimedia/amarok/src/collectionbrowser.cpp #609336:609337
@@ -137,9 +137,7 @@
 
 
     KActionCollection* ac = new KActionCollection( this );
-    m_scanAction = new KAction( i18n( "Scan Changes" ), Amarok::icon( "refresh" ), 0, CollectionDB::instance(), SLOT( scanModifiedDirs() ), ac, "Start Scan" );
 
-    // we need m_scanAction to be initialized before CollectionView's CTOR
     m_view = new CollectionView( this );
     m_view->installEventFilter( this );
 
@@ -379,13 +377,6 @@
     m_toolbar->insertLineSeparator();
 
     m_showDividerAction->plug( m_toolbar );
-
-    if ( !AmarokConfig::monitorChanges() ) {
-        m_toolbar->setIconText( KToolBar::IconTextRight, false );
-        m_scanAction->plug( m_toolbar );
-        m_toolbar->setIconText( KToolBar::IconOnly, false );
-    }
-
     m_configureAction->plug( m_toolbar );
 
     //This would break things if the toolbar is too big, see bug #121915
@@ -709,9 +700,6 @@
 
         if ( rescan )
             CollectionDB::instance()->startScan();
-
-        m_parent->m_scanAction->setEnabled( !AmarokConfig::monitorChanges() );
-        m_parent->layoutToolbar();
     }
 }
 
@@ -719,7 +707,7 @@
 void
 CollectionView::scanStarted() // SLOT
 {
-    m_parent->m_scanAction->setEnabled( false );
+    Amarok::actionCollection()->action("update_collection")->setEnabled( false );
 }
 
 
@@ -731,7 +719,7 @@
         renderView(true);
     }
 
-    m_parent->m_scanAction->setEnabled( !AmarokConfig::monitorChanges() );
+    Amarok::actionCollection()->action("update_collection")->setEnabled( true );
 }
 
 
--- trunk/extragear/multimedia/amarok/src/collectionbrowser.h #609336:609337
@@ -84,7 +84,6 @@
         KTabBar* m_tabs; //tree-view, flat-view tabs
         class KToolBar    *m_toolbar;
         KAction           *m_configureAction;
-        KAction           *m_scanAction;
         // For iPod-style browsing
         KAction           *m_ipodIncrement, *m_ipodDecrement;
         class KToolBar    *m_ipodToolbar;
--- trunk/extragear/multimedia/amarok/src/playlistwindow.cpp #609336:609337
@@ -148,7 +148,9 @@
     new KAction( i18n("Script Manager"), Amarok::icon( "scripts" ), 0, this, SLOT(showScriptSelector()), ac, "script_manager" );
     new KAction( i18n("Queue Manager"), Amarok::icon( "queue" ), 0, this, SLOT(showQueueManager()), ac, "queue_manager" );
     new KAction( i18n("Statistics"), Amarok::icon( "info" ), 0, this, SLOT(showStatistics()), ac, "statistics" );
+    new KAction( i18n("Update Collection"), Amarok::icon( "refresh" ), 0, CollectionDB::instance(), SLOT( scanModifiedDirs() ), actionCollection(), "update_collection" );
 
+
     m_lastfmTags << "Alternative" << "Ambient" << "Chill Out" << "Classical" << "Dance"
                  << "Electronica" << "Favorites" << "Heavy Metal" << "Hip Hop" << "Indie Rock"
                  << "Industrial" << "Japanese" << "Pop" << "Psytrance" << "Rap" << "Rock"
@@ -351,6 +353,7 @@
     actionCollection()->action("script_manager")->plug( m_toolsMenu );
     actionCollection()->action("statistics")->plug( m_toolsMenu );
     m_toolsMenu->insertSeparator();
+    actionCollection()->action("update_collection")->plug( m_toolsMenu );
     m_toolsMenu->insertItem( SmallIconSet( Amarok::icon( "rescan" ) ), i18n("&Rescan Collection"), Amarok::Menu::ID_RESCAN_COLLECTION );
 
     #if defined HAVE_XMMS || defined HAVE_LIBVISUAL
Comment 10 Ron Eggler 2006-11-30 16:10:20 UTC
but the 'Rescan collection' entry in the main menu is recreating the whole collection and not just looking for changes.... which actually (depending on the size of the collection) takes "hours"...
Comment 11 richlv 2006-11-30 16:13:08 UTC
well, yeah, that's why markey moved (not always visible) 'scan changes' to 'update collection', which would only react upon changed directories, not all of your collection :)
Comment 12 Ron Eggler 2006-12-01 17:00:37 UTC
Love that new menu entry. That's perfect. 
Thanks alot! It is Highly appreciated!

roN