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 skip list to personal settings, bump version to 0.6.0, new dist file

This commit is contained in:
frankdelange 2015-01-09 21:09:18 +01:00
parent 256d2eb879
commit 30ccabed34
7 changed files with 13 additions and 5 deletions

View file

@ -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 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) 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') 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.0.tar.gz vendored Normal file

Binary file not shown.

View file

@ -18,8 +18,9 @@ namespace OCA\Files_Opds;
$l = new \OC_L10N('files_opds');
$opdsEnable = isset($_POST['opdsEnable']) ? $_POST['opdsEnable'] : 'false';
$rootPath = isset($_POST['rootPath']) ? $_POST['rootPath'] : null;
$rootPath = isset($_POST['rootPath']) ? $_POST['rootPath'] : '/Library';
$fileTypes = isset($_POST['fileTypes']) ? $_POST['fileTypes'] : '';
$skipList = isset($_POST['skipList']) ? $_POST['skipList'] : 'metadata.opf,cover.jpg';
$feedTitle = isset($_POST['feedTitle']) ? $_POST['feedTitle'] : $l->t("%s's Library", \OCP\User::getDisplayName());
if (!is_null($rootPath)){
@ -39,6 +40,7 @@ if (!is_null($rootPath)){
}
Config::set('enable', $opdsEnable);
Config::set('file_types', $fileTypes);
Config::set('skip_list', $skipList);
Config::set('feed_title', $feedTitle);
Config::set('id', Util::genUuid());
exit();

View file

@ -4,7 +4,7 @@
<name>OPDS catalog</name>
<description>Personal OPDS catalog</description>
<licence>AGPL</licence>
<version>0.5.9</version>
<version>0.6.0</version>
<author>Frank de Lange</author>
<requiremin>7.0</requiremin>
<shipped>true</shipped>

View file

@ -25,6 +25,7 @@ $(document).ready(function(){
opdsEnable : opdsEnable,
rootPath : $('#opds-root-path').val(),
fileTypes : $('#opds-file-types').val(),
skipList : $('#opds-skip-list').val(),
feedTitle : $('#opds-feed-title').val()
};
OC.msg.startSaving('#opds-personal .msg');
@ -34,8 +35,8 @@ $(document).ready(function(){
OC.msg.finishedSaving('#opds-personal .msg', data);
}
};
$('#opds-root-path,#opds-file-types,#opds-feed-title').blur(opdsSettings.save);
$('#opds-root-path,#opds-file-types,#opds-feed-title').keypress(function( event ) {
$('#opds-root-path,#opds-file-types,#opds-feed-title,#opds-skip-list').blur(opdsSettings.save);
$('#opds-root-path,#opds-file-types,#opds-feed-title,#opds-skip-list').keypress(function( event ) {
if (event.which == 13) {
event.preventDefault();
opdsSettings.save();

View file

@ -20,6 +20,7 @@ $tmpl->assign('opdsEnable-checked', ($opdsEnable === 'true') ? 'checked="checked
$tmpl->assign('opdsEnable-value', ($opdsEnable === 'true') ? '1' : '0');
$tmpl->assign('rootPath', Config::get('root_path', '/Library'));
$tmpl->assign('fileTypes', Config::get('file_types', ''));
$tmpl->assign('skipList', Config::get('skip_list', 'metadata.opf,cover.jpg'));
$tmpl->assign('feedTitle', Config::get('feed_title', $l->t("%s's Library", \OCP\User::getDisplayName())));
$tmpl->assign('bookshelf-count', Bookshelf::count());
$tmpl->assign('feedUrl', \OC_Helper::linkToAbsolute('','index.php') . '/apps/files_opds/');

View file

@ -32,6 +32,10 @@
<td><label for="opds-file-types"><?php p($l->t('Supported extensions:')) ?></label></td>
<td><input type="text" id="opds-file-types" title="<?php p($l->t("Enter list of comma-separated extensions (eg. pdf,epub,doc,txt). Leave blank to publish all file types.")); ?>" value="<?php p($_['fileTypes']) ?>" /></td>
</tr>
<tr>
<td><label for="opds-skip-list"><?php p($l->t('Skip these filenames:')) ?></label></td>
<td><input type="text" id="opds-skip-list" title="<?php p($l->t("Enter list of comma-separated file names which should be skipped. Leave blank to use the default skip list.")); ?>" value="<?php p($_['skipList']) ?>" /></td>
</tr>
</table>
<br>
<div>