From kde-commits Sun Jul 31 22:08:39 2011 From: Robin Appelman Date: Sun, 31 Jul 2011 22:08:39 +0000 To: kde-commits Subject: [owncloud] apps/media: use db transitions for collection scanner Message-Id: <20110731220839.11EC2A60B4 () git ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=131215016619851 Git commit 6e2ce76223eb6f0dcd1ef34e086fa59eb5fb3f8b by Robin Appelman. Committed on 31/07/2011 at 20:25. Pushed by rappelman into branch 'master'. use db transitions for collection scanner M +2 -0 apps/media/lib_scanner.php http://commits.kde.org/owncloud/6e2ce76223eb6f0dcd1ef34e086fa59eb5fb3f8b diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php index e3cb2f0..f788562 100644 --- a/apps/media/lib_scanner.php +++ b/apps/media/lib_scanner.php @@ -37,6 +37,7 @@ class OC_MEDIA_SCANNER{ * @return int the number of songs found */ public static function scanFolder($path){ + OC_DB::beginTransaction(); if (OC_Filesystem::is_dir($path)) { $songs=0; if ($dh = OC_Filesystem::opendir($path)) { @@ -59,6 +60,7 @@ class OC_MEDIA_SCANNER{ }else{ $songs=0; } + OC_DB::commit(); return $songs; }