Ajout d'un historique des vidéos YouTube dans la base de données et l'interface utilisateur. Création de la table youtube_video_history pour stocker les vidéos détectées, avec des fonctionnalités pour afficher l'historique et forcer l'envoi de notifications Discord. Mise à jour des modèles, des routes et des templates pour intégrer cette nouvelle fonctionnalité.
This commit is contained in:
@@ -195,6 +195,21 @@ class YouTubeNotification(db.Model):
|
||||
embed_image = db.Column(db.Boolean, default=True)
|
||||
|
||||
|
||||
class YouTubeVideoHistory(db.Model):
|
||||
__tablename__ = 'youtube_video_history'
|
||||
id = db.Column(db.Integer, primary_key=True)
|
||||
notification_id = db.Column(db.Integer, db.ForeignKey('youtube_notification.id'), nullable=False)
|
||||
video_id = db.Column(db.String(128), nullable=False)
|
||||
title = db.Column(db.String(512))
|
||||
url = db.Column(db.String(512))
|
||||
channel_name = db.Column(db.String(256))
|
||||
thumbnail = db.Column(db.String(512))
|
||||
published_at = db.Column(db.String(64))
|
||||
is_short = db.Column(db.Boolean, default=False)
|
||||
notified = db.Column(db.Boolean, default=False)
|
||||
detected_at = db.Column(db.DateTime, default=datetime.utcnow)
|
||||
|
||||
|
||||
class FreeLootEntry(db.Model):
|
||||
__tablename__ = 'freeloot_entry'
|
||||
entry_id = db.Column(db.String(256), primary_key=True)
|
||||
|
||||
@@ -178,6 +178,21 @@ CREATE TABLE IF NOT EXISTS `webapp_page_permission` (
|
||||
description VARCHAR(256) NULL
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `youtube_video_history` (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`notification_id` INTEGER NOT NULL,
|
||||
`video_id` VARCHAR(128) NOT NULL,
|
||||
`title` VARCHAR(512),
|
||||
`url` VARCHAR(512),
|
||||
`channel_name` VARCHAR(256),
|
||||
`thumbnail` VARCHAR(512),
|
||||
`published_at` VARCHAR(64),
|
||||
`is_short` BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
`notified` BOOLEAN NOT NULL DEFAULT FALSE,
|
||||
`detected_at` DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
FOREIGN KEY (`notification_id`) REFERENCES `youtube_notification`(`id`) ON DELETE CASCADE
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `freeloot_entry` (
|
||||
entry_id VARCHAR(256) PRIMARY KEY
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user