summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorRobin Appelman <icewind1991@gmail.com>2012-01-08 18:01:33 +0100
committerRobin Appelman <icewind1991@gmail.com>2012-01-08 18:01:33 +0100
commitccc43f0ea02a048583fff715f00cda0280124586 (patch)
tree31d3c5643646a8f2cabefddf6f5a24264667b3c3 /apps
parent799a7db638a71af91329c1781c482eacbd038ace (diff)
parent37f5a8cdb4d2486982117c5d5984a253c2192e0b (diff)
downloadnextcloud-server-ccc43f0ea02a048583fff715f00cda0280124586.tar.gz
nextcloud-server-ccc43f0ea02a048583fff715f00cda0280124586.zip
merge master into filesystem
Diffstat (limited to 'apps')
-rw-r--r--apps/admin_dependencies_chk/settings.php6
-rw-r--r--apps/calendar/l10n/xgettextfiles3
-rwxr-xr-xapps/calendar/templates/calendar.php1
-rw-r--r--apps/calendar/templates/lAfix.php39
-rw-r--r--apps/gallery/ajax/cover.php22
-rw-r--r--apps/gallery/ajax/createAlbum.php22
-rw-r--r--apps/gallery/ajax/galleryOp.php22
-rw-r--r--apps/gallery/ajax/getAlbums.php22
-rw-r--r--apps/gallery/ajax/getCovers.php22
-rw-r--r--apps/gallery/ajax/scanForAlbums.php21
-rw-r--r--apps/gallery/ajax/thumbnail.php22
-rw-r--r--apps/gallery/appinfo/app.php22
-rw-r--r--apps/gallery/appinfo/info.xml2
-rw-r--r--apps/gallery/index.php22
-rw-r--r--apps/gallery/lib/album.php21
-rw-r--r--apps/gallery/lib/hooks_handlers.php29
-rw-r--r--apps/gallery/lib/images_utils.php22
-rw-r--r--apps/gallery/lib/photo.php21
-rw-r--r--apps/gallery/lib/scanner.php21
-rw-r--r--apps/media/css/music.css4
-rw-r--r--apps/media/js/player.js4
-rw-r--r--apps/media/js/playlist.js16
-rw-r--r--apps/media/lib_scanner.php110
23 files changed, 418 insertions, 78 deletions
diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php
index 34028056dbe..ce90dd604ca 100644
--- a/apps/admin_dependencies_chk/settings.php
+++ b/apps/admin_dependencies_chk/settings.php
@@ -45,12 +45,6 @@ $modules[] =array(
'message'=> $l->t('The php-gd module is needed to create thumbnails of your images'));
$modules[] =array(
- 'status' => OC_Helper::canExecute("mp3info") ? 'ok' : 'warning',
- 'part'=> 'mp3info',
- 'modules'=> array('media'),
- 'message'=> $l->t('The program mp3info is useful to discover ID3 tags of your music files'));
-
-$modules[] =array(
'status' => function_exists("ldap_bind") ? 'ok' : 'error',
'part'=> 'php-ldap',
'modules'=> array('user_ldap'),
diff --git a/apps/calendar/l10n/xgettextfiles b/apps/calendar/l10n/xgettextfiles
index 27b8e457193..a8c2601045f 100644
--- a/apps/calendar/l10n/xgettextfiles
+++ b/apps/calendar/l10n/xgettextfiles
@@ -8,4 +8,5 @@
../templates/part.eventform.php
../templates/part.import.php
../templates/part.newevent.php
-../templates/settings.php \ No newline at end of file
+../templates/settings.php
+../templates/lAfix.php \ No newline at end of file
diff --git a/apps/calendar/templates/calendar.php b/apps/calendar/templates/calendar.php
index 92c1b8a778a..50d3d70347a 100755
--- a/apps/calendar/templates/calendar.php
+++ b/apps/calendar/templates/calendar.php
@@ -25,6 +25,7 @@
$date = substr($data['startdate'], 0, 10);
list($year, $month, $day) = explode('-', $date);
echo '$(\'#calendar_holder\').fullCalendar(\'gotoDate\', ' . $year . ', ' . --$month . ', ' . $day . ');';
+ echo '$(\'#dialog_holder\').load(OC.filePath(\'calendar\', \'ajax\', \'editeventform.php\') + \'?id=\' + ' . $_['showevent'] . ' , Calendar.UI.startEventDialog);';
}
?>
});
diff --git a/apps/calendar/templates/lAfix.php b/apps/calendar/templates/lAfix.php
new file mode 100644
index 00000000000..61025ae6dea
--- /dev/null
+++ b/apps/calendar/templates/lAfix.php
@@ -0,0 +1,39 @@
+<?php
+$l->t('Sunday');
+$l->t('Monday');
+$l->t('Tuesday');
+$l->t('Wednesday');
+$l->t('Thursday');
+$l->t('Friday');
+$l->t('Saturday');
+$l->t('Sun.');
+$l->t('Mon.');
+$l->t('Tue.');
+$l->t('Wed.');
+$l->t('Thu.');
+$l->t('Fri.');
+$l->t('Sat.');
+$l->t('January');
+$l->t('February');
+$l->t('March');
+$l->t('April');
+$l->t('May');
+$l->t('June');
+$l->t('July');
+$l->t('August');
+$l->t('September');
+$l->t('October');
+$l->t('November');
+$l->t('December');
+$l->t('Jan.');
+$l->t('Feb.');
+$l->t('Mar.');
+$l->t('Apr.');
+$l->t('May.');
+$l->t('Jun.');
+$l->t('Jul.');
+$l->t('Aug.');
+$l->t('Sep.');
+$l->t('Oct.');
+$l->t('Nov.');
+$l->t('Dec.'); \ No newline at end of file
diff --git a/apps/gallery/ajax/cover.php b/apps/gallery/ajax/cover.php
index d83f4daaa52..181a919375d 100644
--- a/apps/gallery/ajax/cover.php
+++ b/apps/gallery/ajax/cover.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
diff --git a/apps/gallery/ajax/createAlbum.php b/apps/gallery/ajax/createAlbum.php
index 9413b54718a..152f5834bcb 100644
--- a/apps/gallery/ajax/createAlbum.php
+++ b/apps/gallery/ajax/createAlbum.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
diff --git a/apps/gallery/ajax/galleryOp.php b/apps/gallery/ajax/galleryOp.php
index 8a006dda637..3d1ed1f33cb 100644
--- a/apps/gallery/ajax/galleryOp.php
+++ b/apps/gallery/ajax/galleryOp.php
@@ -1,4 +1,26 @@
<?
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
require_once(OC::$CLASSPATH['OC_Gallery_Album']);
OC_JSON::checkLoggedIn();
diff --git a/apps/gallery/ajax/getAlbums.php b/apps/gallery/ajax/getAlbums.php
index e4736076fed..9e9c6ef496c 100644
--- a/apps/gallery/ajax/getAlbums.php
+++ b/apps/gallery/ajax/getAlbums.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
diff --git a/apps/gallery/ajax/getCovers.php b/apps/gallery/ajax/getCovers.php
index db7c8e9fcde..4db73d0fbf3 100644
--- a/apps/gallery/ajax/getCovers.php
+++ b/apps/gallery/ajax/getCovers.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
diff --git a/apps/gallery/ajax/scanForAlbums.php b/apps/gallery/ajax/scanForAlbums.php
index b1f0a433a42..b8ed639d9dc 100644
--- a/apps/gallery/ajax/scanForAlbums.php
+++ b/apps/gallery/ajax/scanForAlbums.php
@@ -1,5 +1,26 @@
<?php
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
diff --git a/apps/gallery/ajax/thumbnail.php b/apps/gallery/ajax/thumbnail.php
index d937691fa03..6d25c7a2536 100644
--- a/apps/gallery/ajax/thumbnail.php
+++ b/apps/gallery/ajax/thumbnail.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php
index 3a2dbcb43ad..9c665fd3500 100644
--- a/apps/gallery/appinfo/app.php
+++ b/apps/gallery/appinfo/app.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
OC::$CLASSPATH['OC_Gallery_Album'] = 'apps/gallery/lib/album.php';
OC::$CLASSPATH['OC_Gallery_Photo'] = 'apps/gallery/lib/photo.php';
OC::$CLASSPATH['OC_Gallery_Scanner'] = 'apps/gallery/lib/scanner.php';
diff --git a/apps/gallery/appinfo/info.xml b/apps/gallery/appinfo/info.xml
index ba51bf0bd55..c275f39bb25 100644
--- a/apps/gallery/appinfo/info.xml
+++ b/apps/gallery/appinfo/info.xml
@@ -6,6 +6,6 @@
<licence>AGPL</licence>
<author>Bartek Przybylski</author>
<require>2</require>
- <description></description>
+ <description>Gallery application for ownCloud</description>
<default_enable/>
</info>
diff --git a/apps/gallery/index.php b/apps/gallery/index.php
index 0cd795bac01..822a5b8e143 100644
--- a/apps/gallery/index.php
+++ b/apps/gallery/index.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../lib/base.php');
OC_Util::checkLoggedIn();
diff --git a/apps/gallery/lib/album.php b/apps/gallery/lib/album.php
index 98876b891c5..a94eff3acd7 100644
--- a/apps/gallery/lib/album.php
+++ b/apps/gallery/lib/album.php
@@ -1,5 +1,26 @@
<?php
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
class OC_Gallery_Album {
public static function create($owner, $name, $path){
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_albums (uid_owner, album_name, album_path) VALUES (?, ?, ?)');
diff --git a/apps/gallery/lib/hooks_handlers.php b/apps/gallery/lib/hooks_handlers.php
index 1bddaf363e3..65f3faaeeaf 100644
--- a/apps/gallery/lib/hooks_handlers.php
+++ b/apps/gallery/lib/hooks_handlers.php
@@ -1,5 +1,26 @@
<?php
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
OC_Hook::connect("OC_Filesystem", "post_write", "OC_Gallery_Hooks_Handlers", "addPhotoFromPath");
OC_Hook::connect("OC_Filesystem", "delete", "OC_Gallery_Hooks_Handlers", "removePhoto");
OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Gallery_Hooks_Handlers", "renamePhoto");
@@ -11,6 +32,7 @@ class OC_Gallery_Hooks_Handlers {
private static $APP_TAG = "Gallery";
private static function isPhoto($filename) {
+ OC_Log::write(self::$APP_TAG, "Checking file ".$filename." with mimetype ".OC_Filesystem::getMimeType($filename), OC_Log::DEBUG);
if (substr(OC_Filesystem::getMimeType($filename), 0, 6) == "image/")
return 1;
return 0;
@@ -18,7 +40,8 @@ class OC_Gallery_Hooks_Handlers {
private static function createAlbum($path) {
$new_album_name = trim(str_replace('/', '.', $path), '.');
- if ($new_album_name == '') $new_album_name = 'main';
+ if ($new_album_name == '')
+ $new_album_name = 'main';
OC_Log::write(self::$APP_TAG, 'Creating new album '.$new_album_name, OC_Log::DEBUG);
OC_Gallery_Album::create(OC_User::getUser(), $new_album_name, $path);
@@ -31,6 +54,7 @@ class OC_Gallery_Hooks_Handlers {
$fullpath = $params['path'];
OC_Log::write(self::$APP_TAG, 'Adding file with path '. $fullpath, OC_Log::DEBUG);
$path = substr($fullpath, 0, strrpos($fullpath, '/'));
+ if ($path == '') $path = '/';
$album = OC_Gallery_Album::find(OC_User::getUser(), null, $path);
if ($album->numRows() == 0) {
@@ -55,7 +79,10 @@ class OC_Gallery_Hooks_Handlers {
public static function renamePhoto($params) {
$olddir = substr($params['oldpath'], 0, strrpos($params['oldpath'], '/'));
$newdir = substr($params['newpath'], 0, strrpos($params['newpath'], '/'));
+ if ($olddir == '') $olddir = '/';
+ if ($newdir == '') $newdir = '/';
if (!self::isPhoto($params['newpath'])) return;
+ OC_Log::write(self::$APP_TAG, 'Moving photo from '.$params['oldpath'].' to '.$params['newpath'], OC_Log::DEBUG);
$album;
$newAlbumId;
$oldAlbumId;
diff --git a/apps/gallery/lib/images_utils.php b/apps/gallery/lib/images_utils.php
index cb46bf3f160..0cfa52eb564 100644
--- a/apps/gallery/lib/images_utils.php
+++ b/apps/gallery/lib/images_utils.php
@@ -1,4 +1,26 @@
<?php
+
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('../../../lib/base.php');
OC_JSON::checkLoggedIn();
OC_JSON::checkAppEnabled('gallery');
diff --git a/apps/gallery/lib/photo.php b/apps/gallery/lib/photo.php
index f8a640819a1..23887098e0f 100644
--- a/apps/gallery/lib/photo.php
+++ b/apps/gallery/lib/photo.php
@@ -1,5 +1,26 @@
<?php
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
class OC_Gallery_Photo{
public static function create($albumId, $img){
$stmt = OC_DB::prepare('INSERT INTO *PREFIX*gallery_photos (album_id, file_path) VALUES (?, ?)');
diff --git a/apps/gallery/lib/scanner.php b/apps/gallery/lib/scanner.php
index f754f913001..3eba9260ac7 100644
--- a/apps/gallery/lib/scanner.php
+++ b/apps/gallery/lib/scanner.php
@@ -1,5 +1,26 @@
<?php
+/**
+* ownCloud - gallery application
+*
+* @author Bartek Przybylski
+* @copyright 2012 Bartek Przybylski bart.p.pl@gmail.com
+*
+* This library is free software; you can redistribute it and/or
+* modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
+* License as published by the Free Software Foundation; either
+* version 3 of the License, or any later version.
+*
+* This library is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU AFFERO GENERAL PUBLIC LICENSE for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this library. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+
require_once('base.php'); // base lib
require_once('images_utils.php');
diff --git a/apps/media/css/music.css b/apps/media/css/music.css
index a6738058be3..41ade44a66f 100644
--- a/apps/media/css/music.css
+++ b/apps/media/css/music.css
@@ -22,11 +22,11 @@ div.jp-volume-bar-value { background:#ccc; width:0; height:0.4em; }
#collection li.album,#collection li.song { margin-left:3em; }
#leftcontent img.remove { display:none; float:right; cursor:pointer; }
#leftcontent li:hover img.remove { display:inline; }
-#leftcontent li {white-space: normal; }
+#leftcontent li div.label { float: left; width: 200px; overflow: hidden; text-overflow: ellipsis; }
#collection li button { float:right; }
#collection li,#playlist li { list-style-type:none; }
.template { display:none; }
-.collection_playing { background:#eee; }
+.collection_playing { background:#eee; font-weight: bold; }
#collection li { padding-right:10px; }
#searchresults input.play, #searchresults input.add { float:left; height:1em; width:1em; }
diff --git a/apps/media/js/player.js b/apps/media/js/player.js
index 3c022e9f8c4..1f76356fd97 100644
--- a/apps/media/js/player.js
+++ b/apps/media/js/player.js
@@ -93,9 +93,11 @@ var PlayList={
ended:PlayList.next,
pause:function(){
localStorage.setItem(oc_current_user+'oc_playlist_playing','false');
+ document.title = "ownCloud";
},
- play:function(){
+ play:function(event){
localStorage.setItem(oc_current_user+'oc_playlist_playing','true');
+ document.title = "\u25b8 " + event.jPlayer.status.media.name + " - " + event.jPlayer.status.media.artist + " - ownCloud";
},
supplied:type,
ready:function(){
diff --git a/apps/media/js/playlist.js b/apps/media/js/playlist.js
index 57180b3be7b..089065989ae 100644
--- a/apps/media/js/playlist.js
+++ b/apps/media/js/playlist.js
@@ -1,11 +1,23 @@
PlayList.render=function(){
$('#playlist').show();
+
+ /*
+ * We should not empty() PlayList.parent() but thorougly manage its
+ * elements instead because some code might be attached to those.
+ * JQuery tipsies are one of them. The following line make sure they
+ * are all removed before we delete the associated <li/>.
+ */
+ $(".tipsy").remove();
+
PlayList.parent.empty();
for(var i=0;i<PlayList.items.length;i++){
var item=PlayList.items[i];
var li=$('<li/>');
- li.append(item.name);
- li.attr('class', 'jp-playlist-' + i);
+ li.attr('class', 'jp-playlist-' + i);
+ li.attr('title', item.artist + ' - ' + item.name + '<br/>(' + item.album + ')');
+ var div = $('<div class="label">' + item.name + '</div>');
+ li.append(div);
+ $('.jp-playlist-' + i).tipsy({gravity:'w', fade:true, live:true, html:true});
var img=$('<img class="remove svg action" src="'+OC.imagePath('core','actions/delete')+'"/>');
img.click(function(event){
event.stopPropagation();
diff --git a/apps/media/lib_scanner.php b/apps/media/lib_scanner.php
index 320b1f79199..4039cce09ee 100644
--- a/apps/media/lib_scanner.php
+++ b/apps/media/lib_scanner.php
@@ -30,7 +30,6 @@ class OC_MEDIA_SCANNER{
//these are used to store which artists and albums we found, it can save a lot of addArtist/addAlbum calls
static private $artists=array();
static private $albums=array();//stored as "$artist/$album" to allow albums with the same name from different artists
- static private $useMp3Info=null;
/**
* scan a folder for music
@@ -70,72 +69,55 @@ class OC_MEDIA_SCANNER{
* @return boolean
*/
public static function scanFile($path){
- if(is_null(self::$useMp3Info)){
- self::$useMp3Info=OC_Helper::canExecute("mp3info");
- }
$file=OC_Filesystem::getLocalFile($path);
- if(substr($path,-3)=='mp3' and self::$useMp3Info){//use the command line tool id3info if possible
- $output=array();
- $size=filesize($file);
- exec('mp3info -p "%a\n%l\n%t\n%n\n%S" "'.$file.'"',$output);
- if(count($output)>4){
- $artist=$output[0];
- $album=$output[1];
- $title=$output[2];
- $track=$output[3];
- $length=$output[4];
- }else{
- return; //invalid mp3 file
- }
+ if(!self::isMusic($path)){
+ return;
+ }
+ if(!self::$getID3){
+ self::$getID3=@new getID3();
+ self::$getID3->encoding='UTF-8';
+ }
+ $data=@self::$getID3->analyze($file);
+ getid3_lib::CopyTagsToComments($data);
+ if(!isset($data['comments'])){
+ OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN);
+ return;
+ }
+ if(!isset($data['comments']['artist'])){
+ OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN);
+ $artist='unknown';
}else{
- if(!self::isMusic($path)){
- return;
- }
- if(!self::$getID3){
- self::$getID3=@new getID3();
- self::$getID3->encoding='UTF-8';
- }
- $data=@self::$getID3->analyze($file);
- getid3_lib::CopyTagsToComments($data);
- if(!isset($data['comments'])){
- OC_Log::write('media',"error reading id3 tags in '$file'",OC_Log::WARN);
- return;
- }
- if(!isset($data['comments']['artist'])){
- OC_Log::write('media',"error reading artist tag in '$file'",OC_Log::WARN);
- $artist='unknown';
- }else{
- $artist=stripslashes($data['comments']['artist'][0]);
- }
- if(!isset($data['comments']['album'])){
- OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN);
- $album='unknown';
- }else{
- $album=stripslashes($data['comments']['album'][0]);
- }
- if(!isset($data['comments']['title'])){
- OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN);
- $title='unknown';
- }else{
- $title=stripslashes($data['comments']['title'][0]);
- }
- $size=$data['filesize'];
- if (isset($data['comments']['track']))
- {
- $track = $data['comments']['track'][0];
- }
- else if (isset($data['comments']['track_number']))
- {
- $track = $data['comments']['track_number'][0];
- $track = explode('/',$track);
- $track = $track[0];
- }
- else
- {
- $track = 0;
- }
- $length=isset($data['playtime_seconds'])?round($data['playtime_seconds']):0;
+ $artist=stripslashes($data['comments']['artist'][0]);
}
+ if(!isset($data['comments']['album'])){
+ OC_Log::write('media',"error reading album tag in '$file'",OC_Log::WARN);
+ $album='unknown';
+ }else{
+ $album=stripslashes($data['comments']['album'][0]);
+ }
+ if(!isset($data['comments']['title'])){
+ OC_Log::write('media',"error reading title tag in '$file'",OC_Log::WARN);
+ $title='unknown';
+ }else{
+ $title=stripslashes($data['comments']['title'][0]);
+ }
+ $size=$data['filesize'];
+ if (isset($data['comments']['track']))
+ {
+ $track = $data['comments']['track'][0];
+ }
+ else if (isset($data['comments']['track_number']))
+ {
+ $track = $data['comments']['track_number'][0];
+ $track = explode('/',$track);
+ $track = $track[0];
+ }
+ else
+ {
+ $track = 0;
+ }
+ $length=isset($data['playtime_seconds'])?round($data['playtime_seconds']):0;
+
if(!isset(self::$artists[$artist])){
$artistId=OC_MEDIA_COLLECTION::addArtist($artist);
self::$artists[$artist]=$artistId;