- Created 10 SVG icon files in app/static/icons/ (Feather Icons style) - Updated base.html with SVG icons in navigation and dark mode toggle - Updated dashboard.html with icons in stats cards and quick actions - Updated content_list_new.html (playlist management) with SVG icons - Updated upload_media.html with upload-related icons - Updated manage_player.html with player management icons - Icons use currentColor for automatic theme adaptation - Removed emoji dependency for better Raspberry Pi compatibility - Added ICON_INTEGRATION.md documentation
60 lines
1.8 KiB
Python
60 lines
1.8 KiB
Python
#!/usr/bin/env python3
|
|
"""Add orientation column to playlist table - Direct SQLite approach"""
|
|
|
|
import sqlite3
|
|
import os
|
|
|
|
def add_orientation_column():
|
|
"""Add orientation column to playlist table using direct SQLite connection."""
|
|
db_path = 'instance/dev.db'
|
|
|
|
if not os.path.exists(db_path):
|
|
print(f"❌ Database not found at: {db_path}")
|
|
return
|
|
|
|
print(f"📁 Opening database: {db_path}")
|
|
|
|
try:
|
|
# Connect to database
|
|
conn = sqlite3.connect(db_path)
|
|
cursor = conn.cursor()
|
|
|
|
# Check if column already exists
|
|
cursor.execute("PRAGMA table_info(playlist)")
|
|
columns = [row[1] for row in cursor.fetchall()]
|
|
|
|
if 'orientation' in columns:
|
|
print("✅ Column 'orientation' already exists in playlist table")
|
|
conn.close()
|
|
return
|
|
|
|
# Add the column
|
|
print("Adding 'orientation' column to playlist table...")
|
|
cursor.execute("""
|
|
ALTER TABLE playlist
|
|
ADD COLUMN orientation VARCHAR(20) DEFAULT 'Landscape' NOT NULL
|
|
""")
|
|
|
|
conn.commit()
|
|
|
|
print("✅ Successfully added 'orientation' column to playlist table")
|
|
print(" Default value: 'Landscape'")
|
|
|
|
# Verify the column was added
|
|
cursor.execute("PRAGMA table_info(playlist)")
|
|
columns = [row[1] for row in cursor.fetchall()]
|
|
if 'orientation' in columns:
|
|
print("✓ Verified: Column exists in database")
|
|
|
|
conn.close()
|
|
|
|
except sqlite3.Error as e:
|
|
print(f"❌ SQLite Error: {e}")
|
|
return
|
|
except Exception as e:
|
|
print(f"❌ Error: {e}")
|
|
return
|
|
|
|
if __name__ == '__main__':
|
|
add_orientation_column()
|