diff --git a/README.md b/README.md index 0d1d22b..ac1f668 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ The OPDS root feed links to a hierarchical navigation feed mirroring the directo The feed is in compliance with the OPDS 1.1 specification according to the online OPDS validator (http://opds-validator.appspot.com/). -In the personal settings page there are options to enable/disable the feed (it is disabled by default), set the feed title, set the feed root directory (the default is /Library), enter a comma-delimited list of extensions to which the feed should be limited (by default this field is empty so it publishes all files descending from the feed root), enter a comma-delimited list of filenames to skip (default is 'metadata.opf,cover.jpg') and clear the personal bookshelf. +In the personal settings page there are options to enable/disable the feed (it is disabled by default), set the feed title, set the feed root directory (the default is /Library), enter a comma-delimited list of extensions to which the feed should be limited (by default this field is empty so it publishes all files descending from the feed root), enter a comma-delimited list of filenames to skip (default is 'metadata.opf,cover.jpg'), schedule a rescan of all metadata and clear the personal bookshelf. The admin settings page contains options to set the feed subtitle, change file preview preferences (which should probably be in core or in a separate app as this changes a system-wide setting ('enabledPreviewProviders')) and change the cover image and thumbnail dimensions. diff --git a/dist/files_opds-0.6.1.tar.gz b/dist/files_opds-0.6.1.tar.gz new file mode 100644 index 0000000..eebb5bf Binary files /dev/null and b/dist/files_opds-0.6.1.tar.gz differ diff --git a/files_opds/ajax/schedule_rescan.php b/files_opds/ajax/schedule_rescan.php new file mode 100644 index 0000000..c6ed6ba --- /dev/null +++ b/files_opds/ajax/schedule_rescan.php @@ -0,0 +1,21 @@ + array( "message" => $l->t("Rescan scheduled")))); diff --git a/files_opds/appinfo/info.xml b/files_opds/appinfo/info.xml index c1dbc41..6ad7f88 100644 --- a/files_opds/appinfo/info.xml +++ b/files_opds/appinfo/info.xml @@ -4,7 +4,7 @@ OPDS catalog Personal OPDS catalog AGPL - 0.6.0 + 0.6.1 Frank de Lange 7.0 true diff --git a/files_opds/js/personal.js b/files_opds/js/personal.js index a897f4c..73c0992 100644 --- a/files_opds/js/personal.js +++ b/files_opds/js/personal.js @@ -17,6 +17,24 @@ $(document).ready(function(){ $('#opds-really-clear-bookshelf,#opds-dont-clear-bookshelf').hide(); }); + // schedule rescan + $('#opds-rescan').on("click", function() { + $('#opds-really-rescan,#opds-dont-rescan').show(); + }); + $('#opds-dont-rescan').on("click", function() { + $('#opds-really-rescan,#opds-dont-rescan').hide(); + }); + $('#opds-really-rescan').on("click", function() { + $.post(OC.filePath('files_opds','ajax','schedule_rescan.php'), {}, + function(result){ + if(result) { + OC.msg.finishedSaving('#opds-personal .scn', result); + } + }); + $('#opds-really-rescan,#opds-dont-rescan').hide(); + }); + + // save settings var opdsSettings = { save : function() { diff --git a/files_opds/lib/meta.php b/files_opds/lib/meta.php index 540972e..f878674 100644 --- a/files_opds/lib/meta.php +++ b/files_opds/lib/meta.php @@ -141,6 +141,17 @@ class Meta return $meta; } + /** + * @brief schedule rescan of metadata + * + */ + public static function rescan() { + $sql = "UPDATE *PREFIX*opds_metadata SET `rescan`=?"; + $args = array(date("Y-m-d H:i:s")); + $query = \OCP\DB::prepare($sql); + $result = $query->execute($args); + } + /** * @brief scan files for metadata * diff --git a/files_opds/templates/personal.php b/files_opds/templates/personal.php index 75ea30c..7475034 100644 --- a/files_opds/templates/personal.php +++ b/files_opds/templates/personal.php @@ -38,6 +38,13 @@
+
+ + " value=" t('Yes, I really want to schedule a rescan of all metadata')); ?>" hidden /> + + +
+
" value=" t('Yes, I really want to clear my personal bookshelf')); ?>" hidden />