1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/castopod_ynh.git synced 2024-09-03 18:16:14 +02:00
This commit is contained in:
ericgaspar 2021-06-21 14:34:06 +02:00
parent 48dde51700
commit fd4171d002
No known key found for this signature in database
GPG key ID: 574F281483054D44
4 changed files with 3 additions and 118 deletions

View file

@ -1,5 +1,5 @@
SOURCE_URL=https://code.podlibre.org/podlibre/castopod-host/uploads/ccf11a6321faa946f7411358ec3d379e/castopod-host-.zip SOURCE_URL=https://code.podlibre.org/podlibre/castopod-host/uploads/c5c188541b6541160a642789bb50acc1/castopod-host-.zip
SOURCE_SUM=726a8db5a14e07c8403e214c745e89b10868dc0becbb6f422b294b860f2e9813 SOURCE_SUM=be02026187a33664413ab4ea37f6d617ab675698b6f273a5ffd0c49931e7b58f
SOURCE_SUM_PRG=sha256sum SOURCE_SUM_PRG=sha256sum
SOURCE_FORMAT=zip SOURCE_FORMAT=zip
SOURCE_IN_SUBDIR=true SOURCE_IN_SUBDIR=true

View file

@ -1,109 +0,0 @@
SET AUTOCOMMIT = 0;
START TRANSACTION;
/* Set category parent_id to be nullable + remove "uncategorized" value */
ALTER TABLE `cp_categories` CHANGE `parent_id` `parent_id` INT(10) UNSIGNED NULL DEFAULT NULL;
UPDATE `cp_categories` SET parent_id = null WHERE parent_id = 0;
DELETE FROM `cp_categories` WHERE id = 0;
/* rename `location_osmid` to `location_osm` */
ALTER TABLE `cp_podcasts` CHANGE `location_osmid` `location_osm` VARCHAR(12) NULL DEFAULT NULL;
ALTER TABLE `cp_episodes` CHANGE `location_osmid` `location_osm` VARCHAR(12) NULL DEFAULT NULL;
/* use more precise DECIMAL type for duration and start time */
ALTER TABLE `cp_episodes` CHANGE `audio_file_duration` `audio_file_duration` DECIMAL(8,3) UNSIGNED NOT NULL COMMENT 'Playtime in seconds';
ALTER TABLE `cp_soundbites` CHANGE `start_time` `start_time` DECIMAL(8,3) UNSIGNED NOT NULL;
ALTER TABLE `cp_soundbites` CHANGE `duration` `duration` DECIMAL(7,3) UNSIGNED NOT NULL;
ALTER TABLE `cp_analytics_podcasts` CHANGE `duration` `duration` DECIMAL(15,3) UNSIGNED NOT NULL;
/* add pages html content in database */
ALTER TABLE `cp_pages` CHANGE `content` `content_markdown` TEXT NOT NULL;
ALTER TABLE `cp_pages` ADD `content_html` TEXT NOT NULL AFTER `content_markdown`;
/* Longitude and latitude precision with DECIMAL */
ALTER TABLE `cp_soundbites` CHANGE `latitude` `latitude` DECIMAL(8,6) NULL DEFAULT NULL;
ALTER TABLE `cp_soundbites` CHANGE `longitude` `longitude` DECIMAL(9,6) NULL DEFAULT NULL;
/* update analytics procedures */
DELIMITER //
DROP PROCEDURE `cp_analytics_podcasts` //
CREATE PROCEDURE `cp_analytics_podcasts`(
IN `p_podcast_id` INT UNSIGNED,
IN `p_episode_id` INT UNSIGNED,
IN `p_country_code` VARCHAR(3),
IN `p_region_code` VARCHAR(3),
IN `p_latitude` DECIMAL(8,6),
IN `p_longitude` DECIMAL(9,6),
IN `p_service` VARCHAR(128),
IN `p_app` VARCHAR(128),
IN `p_device` VARCHAR(32),
IN `p_os` VARCHAR(32),
IN `p_bot` TINYINT(1) UNSIGNED,
IN `p_filesize` INT UNSIGNED,
IN `p_duration` DECIMAL(8,3) UNSIGNED,
IN `p_age` INT UNSIGNED,
IN `p_new_listener` TINYINT(1) UNSIGNED
) COMMENT 'Add one hit in podcast logs tables.' DETERMINISTIC MODIFIES SQL DATA SQL SECURITY INVOKER
BEGIN
SET @current_datetime = NOW();
SET @current_date = DATE(@current_datetime);
SET @current_hour = HOUR(@current_datetime);
IF NOT `p_bot` THEN
INSERT INTO `cp_analytics_podcasts`(`podcast_id`, `date`)
VALUES (p_podcast_id, @current_date)
ON DUPLICATE KEY UPDATE
`duration`=`duration`+`p_duration`,
`bandwidth`=`bandwidth`+`p_filesize`,
`hits`=`hits`+1,
`unique_listeners`=`unique_listeners`+`p_new_listener`;
INSERT INTO `cp_analytics_podcasts_by_hour`(`podcast_id`, `date`, `hour`)
VALUES (p_podcast_id, @current_date, @current_hour)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
INSERT INTO `cp_analytics_podcasts_by_episode`(`podcast_id`, `episode_id`, `date`, `age`)
VALUES (p_podcast_id, p_episode_id, @current_date, p_age)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
INSERT INTO `cp_analytics_podcasts_by_country`(`podcast_id`, `country_code`, `date`)
VALUES (p_podcast_id, p_country_code, @current_date)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
INSERT INTO `cp_analytics_podcasts_by_region`(`podcast_id`, `country_code`, `region_code`, `latitude`, `longitude`, `date`)
VALUES (p_podcast_id, p_country_code, p_region_code, p_latitude, p_longitude, @current_date)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
END IF;
INSERT INTO `cp_analytics_podcasts_by_player`(`podcast_id`, `service`, `app`, `device`, `os`, `is_bot`, `date`)
VALUES (p_podcast_id, p_service, p_app, p_device, p_os, p_bot, @current_date)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
END //
DROP PROCEDURE `cp_analytics_unknown_useragents` //
CREATE PROCEDURE `cp_analytics_unknown_useragents`(IN `p_useragent` VARCHAR(191)) COMMENT 'Add an unknown useragent to table cp_analytics_unknown_useragents.' DETERMINISTIC MODIFIES SQL DATA SQL SECURITY INVOKER INSERT INTO `cp_analytics_unknown_useragents`(`useragent`)
VALUES (p_useragent)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1 //
DROP PROCEDURE `cp_analytics_website` //
CREATE PROCEDURE `cp_analytics_website`(
IN `p_podcast_id` INT UNSIGNED,
IN `p_browser` VARCHAR(191),
IN `p_entry_page` VARCHAR(512),
IN `p_referer_url` VARCHAR(512),
IN `p_domain` VARCHAR(128),
IN `p_keywords` VARCHAR(384)
) COMMENT 'Add one hit in website logs tables.' DETERMINISTIC MODIFIES SQL DATA SQL SECURITY INVOKER BEGIN
SET @current_date = DATE(NOW());
INSERT INTO cp_analytics_website_by_browser(`podcast_id`, `browser`, `date`)
VALUES (p_podcast_id, p_browser, @current_date)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
INSERT INTO cp_analytics_website_by_referer(`podcast_id`, `referer_url`, `domain`, `keywords`, `date`)
VALUES (p_podcast_id, p_referer_url, p_domain, p_keywords, @current_date)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
INSERT INTO cp_analytics_website_by_entry_page(`podcast_id`, `entry_page_url`, `date`)
VALUES (p_podcast_id, p_entry_page, @current_date)
ON DUPLICATE KEY UPDATE `hits`=`hits`+1;
END //
COMMIT;

View file

@ -6,7 +6,7 @@
"en": "Hosting platform made for podcasters", "en": "Hosting platform made for podcasters",
"fr": "Plateforme d'hébergement conçue pour les podcasteurs" "fr": "Plateforme d'hébergement conçue pour les podcasteurs"
}, },
"version": "1.0.0-59~ynh1", "version": "1.0.0-60~ynh1",
"url": "https://podlibre.org/", "url": "https://podlibre.org/",
"upstream": { "upstream": {
"license": "GPL-3.0-only", "license": "GPL-3.0-only",

View file

@ -93,12 +93,6 @@ chmod 750 "$final_path"
chmod -R o-rwx "$final_path" chmod -R o-rwx "$final_path"
chown -R $app:www-data "$final_path" chown -R $app:www-data "$final_path"
#=================================================
# UPGRADE DATABASE
#=================================================
#ynh_mysql_execute_file_as_root --file=../conf/upgrade.sql --database=$db_name
#================================================= #=================================================
# NGINX CONFIGURATION # NGINX CONFIGURATION
#================================================= #=================================================