Ajout de la gestion des publications Patreon dans la base de données. Création de la table patreon_post avec les colonnes nécessaires et mise à jour des migrations pour intégrer ces nouvelles colonnes. Intégration de la vérification des publications Patreon dans le bot Discord et ajout de liens vers Patreon dans l'interface utilisateur.

This commit is contained in:
2026-03-07 11:01:58 +01:00
parent a2ade9deeb
commit 540d23a3cf
9 changed files with 654 additions and 11 deletions
+18
View File
@@ -166,6 +166,23 @@ def _doAddColumnMigrations(cursor: Cursor):
except Exception as e:
logging.warning(f"Seed twitch_event_notification {ev}: {e}")
# Colonnes supplémentaires pour patreon_post (historique + statut notification)
if _tableExists('patreon_post', cursor):
patreon_columns = [
('title', 'VARCHAR(512)'),
('link', 'VARCHAR(1024)'),
('description', 'TEXT'),
('published_at', 'VARCHAR(64)'),
('notified', 'BOOLEAN NOT NULL DEFAULT 0'),
]
for col_name, col_type in patreon_columns:
if not _tableHaveColumn('patreon_post', col_name, cursor):
try:
cursor.execute(f'ALTER TABLE patreon_post ADD COLUMN {col_name} {col_type}')
logging.info(f"Colonne {col_name} ajoutée à patreon_post")
except Exception as e:
logging.warning(f"Colonne patreon_post.{col_name}: {e}")
# Table webapp_user (auth)
if not _tableExists('webapp_user', cursor):
try:
@@ -251,6 +268,7 @@ def _doSeedAuth(cursor: Cursor):
("youtube", 1, 2),
("protondb", 1, 2),
("freeloot", 1, 2),
("patreon", 1, 2),
("moderation", 1, 2),
("users", 5, 5),
("settings", 5, 5),
+10
View File
@@ -228,6 +228,16 @@ class TwitchBannedWord(db.Model):
created_at = db.Column(db.DateTime, default=datetime.utcnow)
class PatreonPost(db.Model):
__tablename__ = 'patreon_post'
guid = db.Column(db.String(512), primary_key=True)
title = db.Column(db.String(512))
link = db.Column(db.String(1024))
description = db.Column(db.Text)
published_at = db.Column(db.String(64))
notified = db.Column(db.Boolean, default=False)
class ModShoutboxMessage(db.Model):
__tablename__ = 'mod_shoutbox_message'
id = db.Column(db.Integer, primary_key=True)
+9
View File
@@ -199,6 +199,15 @@ CREATE TABLE IF NOT EXISTS `twitch_event_notification` (
last_clip_id VARCHAR(128) NULL
);
CREATE TABLE IF NOT EXISTS `patreon_post` (
guid VARCHAR(512) PRIMARY KEY,
title VARCHAR(512),
link VARCHAR(1024),
description TEXT,
published_at VARCHAR(64),
notified BOOLEAN NOT NULL DEFAULT FALSE
);
CREATE TABLE IF NOT EXISTS `mod_shoutbox_message` (
id INTEGER PRIMARY KEY AUTOINCREMENT,
`author` VARCHAR(64) NOT NULL,