1
0
Fork 0
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:
frankdelange 2015-01-09 23:49:26 +01:00
parent 30ccabed34
commit 0d96eb08a4
7 changed files with 59 additions and 2 deletions

View 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"))));

View file

@ -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>

View file

@ -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() {

View file

@ -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
*

View file

@ -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 />