mirror of
https://github.com/Yetangitu/owncloud-apps.git
synced 2025-10-02 14:49:17 +02:00
files_opds: add option to schedule metadata rescan, bumped version to v0.6.1, new dist file
This commit is contained in:
parent
30ccabed34
commit
0d96eb08a4
7 changed files with 59 additions and 2 deletions
|
@ -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.
|
||||
|
||||
|
|
BIN
dist/files_opds-0.6.1.tar.gz
vendored
Normal file
BIN
dist/files_opds-0.6.1.tar.gz
vendored
Normal file
Binary file not shown.
21
files_opds/ajax/schedule_rescan.php
Normal file
21
files_opds/ajax/schedule_rescan.php
Normal file
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
/**
|
||||
* ownCloud - Files_Opds App
|
||||
*
|
||||
* @author Frank de Lange
|
||||
* @copyright 2014 Frank de Lange
|
||||
*
|
||||
* This file is licensed under the Affero General Public License version 3 or
|
||||
* later.
|
||||
*/
|
||||
|
||||
namespace OCA\Files_Opds;
|
||||
|
||||
$l = new \OC_L10N('files_opds');
|
||||
|
||||
\OCP\JSON::checkLoggedIn();
|
||||
\OCP\JSON::callCheck();
|
||||
|
||||
Meta::rescan();
|
||||
\OCP\JSON::success(array( "data" => array( "message" => $l->t("Rescan scheduled"))));
|
|
@ -4,7 +4,7 @@
|
|||
<name>OPDS catalog</name>
|
||||
<description>Personal OPDS catalog</description>
|
||||
<licence>AGPL</licence>
|
||||
<version>0.6.0</version>
|
||||
<version>0.6.1</version>
|
||||
<author>Frank de Lange</author>
|
||||
<requiremin>7.0</requiremin>
|
||||
<shipped>true</shipped>
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -38,6 +38,13 @@
|
|||
</tr>
|
||||
</table>
|
||||
<br>
|
||||
<div>
|
||||
<input type="button" id="opds-rescan" value="<?php p($l -> t('Schedule rescan')); ?>" />
|
||||
<input type="button" id="opds-really-rescan" title="<?php p($l->t("Schedule a rescan of all metadata.")); ?>" value="<?php p($l -> t('Yes, I really want to schedule a rescan of all metadata')); ?>" hidden />
|
||||
<input type="button" id="opds-dont-rescan" value="<?php p($l -> t('No, I do not want to schedule a rescan of all metadata')); ?>" hidden />
|
||||
<span class="scn"></span>
|
||||
</div>
|
||||
<br>
|
||||
<div>
|
||||
<input type="button" id="opds-clear-bookshelf" value="<?php p($l -> t('Clear Bookshelf')); ?>" />
|
||||
<input type="button" id="opds-really-clear-bookshelf" title="<?php p($l->t("Clear list of downloaded books from bookshelf. This only clears the list, it does not delete any books.")); ?>" value="<?php p($l -> t('Yes, I really want to clear my personal bookshelf')); ?>" hidden />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue