diff --git a/files_opds/ajax/personal.php b/files_opds/ajax/personal.php index 1be74cb..6d86ea7 100644 --- a/files_opds/ajax/personal.php +++ b/files_opds/ajax/personal.php @@ -22,6 +22,7 @@ $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", \OC_User::getDisplayName()); +$opdsoldMime = isset($_POST['opdsoldMime']) ? $_POST['opdsoldMime'] : ''; if (!strlen($rootPath) || \OC\Files\Filesystem::isValidPath($rootPath) === false || @@ -37,6 +38,7 @@ if (!strlen($rootPath) || Config::set('file_types', $fileTypes); Config::set('skip_list', $skipList); Config::set('feed_title', $feedTitle); + Config::set('old_mime', $opdsoldMime); Config::set('id', Util::genUuid()); \OC_JSON::success( diff --git a/files_opds/js/personal.js b/files_opds/js/personal.js index 73c0992..db68273 100644 --- a/files_opds/js/personal.js +++ b/files_opds/js/personal.js @@ -39,8 +39,10 @@ $(document).ready(function(){ var opdsSettings = { save : function() { var opdsEnable = document.getElementById('opds-enable').checked ? 'true' : 'false'; + var opdsoldMime = document.getElementById('opds-oldmime').checked ? 'true' : 'false'; var data = { opdsEnable : opdsEnable, + opdsoldMime : opdsoldMime, rootPath : $('#opds-root-path').val(), fileTypes : $('#opds-file-types').val(), skipList : $('#opds-skip-list').val(), @@ -61,5 +63,6 @@ $(document).ready(function(){ } }); $('#opds-enable').on("change", opdsSettings.save); + $('#opds-oldmime').on("change", opdsSettings.save); }); diff --git a/files_opds/personal.php b/files_opds/personal.php index 79593ba..5a36565 100644 --- a/files_opds/personal.php +++ b/files_opds/personal.php @@ -18,6 +18,7 @@ $l = \OC::$server->getL10N('files_opds'); $tmpl = new \OCP\Template('files_opds', 'personal'); $opdsEnable = Config::get('enable', false); +$opdsoldMime = Config::get('old_mime', false); $tmpl->assign('opdsEnable-checked', ($opdsEnable === 'true') ? 'checked="checked"' : ''); $tmpl->assign('opdsEnable-value', ($opdsEnable === 'true') ? '1' : '0'); $tmpl->assign('rootPath', Config::get('root_path', '/Library')); @@ -26,6 +27,8 @@ $tmpl->assign('skipList', Config::get('skip_list', 'metadata.opf,cover.jpg')); $tmpl->assign('feedTitle', Config::get('feed_title', $l->t("%s's Library", \OC_User::getDisplayName()))); $tmpl->assign('bookshelf-count', Bookshelf::count()); $tmpl->assign('feedUrl', Util::linkToAbsolute('','index.php') . '/apps/files_opds/'); +$tmpl->assign('opdsoldMime-checked', ($opdsoldMime === 'true') ? 'checked="checked"' : ''); +$tmpl->assign('opdsoldMime-value', ($opdsoldMime === 'true') ? '1' : '0'); return $tmpl->fetchPage(); diff --git a/files_opds/templates/part.feed.acquisition.php b/files_opds/templates/part.feed.acquisition.php index 9712b02..23f82dc 100644 --- a/files_opds/templates/part.feed.acquisition.php +++ b/files_opds/templates/part.feed.acquisition.php @@ -1,4 +1,13 @@ - + + <?php p($_['file_meta']['title']); ?> id: @@ -18,10 +27,10 @@ - - - + - + diff --git a/files_opds/templates/personal.php b/files_opds/templates/personal.php index ac1823d..f3f705a 100644 --- a/files_opds/templates/personal.php +++ b/files_opds/templates/personal.php @@ -23,7 +23,8 @@ style('files_opds', 'settings');
type="checkbox" class="checkbox"> - + +

@@ -43,6 +44,10 @@ style('files_opds', 'settings'); + + + +
" value="" />
type="checkbox" title="For example use application/x-cbr instead of application/comicbook+rar"/>