From 1a51f939455f0be41cc1ebb5a1c7aa626b718361 Mon Sep 17 00:00:00 2001 From: DanielnetoDotCom Date: Thu, 25 Feb 2021 08:34:48 -0300 Subject: [PATCH] Version 10.4 https://github.com/WWBN/AVideo/pull/4589 --- install/checkConfiguration.php | 2 +- install/database.sql | 17 +++++++++++++++++ updatedb/updateDb.v10.4.sql | 30 ++++++++++++++++++++++++++++++ view/include/footer.php | 12 ------------ 4 files changed, 48 insertions(+), 13 deletions(-) create mode 100644 updatedb/updateDb.v10.4.sql diff --git a/install/checkConfiguration.php b/install/checkConfiguration.php index e70c127d6c..649664291a 100644 --- a/install/checkConfiguration.php +++ b/install/checkConfiguration.php @@ -4,7 +4,7 @@ if (file_exists("../videos/configuration.php")) { exit; } -$installationVersion = "10.3"; +$installationVersion = "10.4"; error_log("Installation: ".__LINE__." ". json_encode($_POST)); header('Content-Type: application/json'); diff --git a/install/database.sql b/install/database.sql index 80a9cbf004..04ccbdf808 100644 --- a/install/database.sql +++ b/install/database.sql @@ -189,6 +189,23 @@ CONSTRAINT `fk_videos_playlists1` ON UPDATE CASCADE) ENGINE = InnoDB; +CREATE TABLE IF NOT EXISTS `videos_metadata` ( + `id` INT NOT NULL AUTO_INCREMENT, + `videos_id` INT NOT NULL, + `resolution` VARCHAR(12) NOT NULL, + `format` VARCHAR(12) NOT NULL, + `stream_id` INT NOT NULL, + `name` VARCHAR(128) NOT NULL, + `value` VARCHAR(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE (`videos_id`, `resolution`, `format`, `stream_id`, `name`), + INDEX `fk_videos_metadata_videos1_idx` (`videos_id` ASC), + CONSTRAINT `fk_videos_metadata_videos1` + FOREIGN KEY (`videos_id`) + REFERENCES `videos` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE = InnoDB; -- ----------------------------------------------------- -- Table `comments` diff --git a/updatedb/updateDb.v10.4.sql b/updatedb/updateDb.v10.4.sql new file mode 100644 index 0000000000..da79cce92d --- /dev/null +++ b/updatedb/updateDb.v10.4.sql @@ -0,0 +1,30 @@ +-- add a metadata table to hold all informations obtained from ffprobe +-- The constrain of videos.id breaks any change at mine, I do not know why, +-- but this is why it is commented out. +SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; +SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; +SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='TRADITIONAL,ALLOW_INVALID_DATES'; + +CREATE TABLE IF NOT EXISTS `videos_metadata` ( + `id` INT NOT NULL AUTO_INCREMENT, + `videos_id` INT NOT NULL, + `resolution` VARCHAR(12) NOT NULL, + `format` VARCHAR(12) NOT NULL, + `stream_id` INT NOT NULL, + `name` VARCHAR(128) NOT NULL, + `value` VARCHAR(255) NOT NULL, + PRIMARY KEY (`id`), + UNIQUE (`videos_id`, `resolution`, `format`, `stream_id`, `name`), + INDEX `fk_videos_metadata_videos1_idx` (`videos_id` ASC), + CONSTRAINT `fk_videos_metadata_videos1` + FOREIGN KEY (`videos_id`) + REFERENCES `videos` (`id`) + ON DELETE CASCADE + ON UPDATE CASCADE +) ENGINE = InnoDB; + +UPDATE configurations SET version = '10.4', modified = now() WHERE id = 1; + +SET SQL_MODE=@OLD_SQL_MODE; +SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; +SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS; \ No newline at end of file diff --git a/view/include/footer.php b/view/include/footer.php index 8676e94b17..4bbc60e76e 100644 --- a/view/include/footer.php +++ b/view/include/footer.php @@ -9,18 +9,6 @@ if (thereIsAnyUpdate()) { hideAfter: 20000 });"; } -/* -if ($version = thereIsAnyRemoteUpdate()) { - $footerjs .= "$.toast({ - heading: 'Update available', - text: '" . __('Our repository is now running at version') . " " . $version->version . "', - showHideTransition: 'plain', - icon: 'warning', - hideAfter: 20000 -});"; -} - * - */ if (empty($advancedCustom)) { $advancedCustom = AVideoPlugin::getObjectData("CustomizeAdvanced"); }