mirror of
https://github.com/PhoenixTwoFive/karaoqueue.git
synced 2025-05-20 03:21:47 +02:00
Move database and config to /data
This commit is contained in:
parent
548b15340b
commit
e51b6ade9a
@ -9,7 +9,7 @@ entry_table = "entries"
|
||||
index_label = "Id"
|
||||
|
||||
def open_db():
|
||||
conn = sqlite3.connect("test.db")
|
||||
conn = sqlite3.connect("data/test.db")
|
||||
conn.execute('PRAGMA encoding = "UTF-8";')
|
||||
return conn
|
||||
|
||||
|
@ -3,7 +3,13 @@ from bs4 import BeautifulSoup
|
||||
import json
|
||||
import os
|
||||
|
||||
config_file = "config.json"
|
||||
data_directory = "data"
|
||||
config_file = data_directory+"/config.json"
|
||||
|
||||
def create_data_directory():
|
||||
if not os.path.exists(data_directory):
|
||||
os.makedirs(data_directory)
|
||||
|
||||
|
||||
def get_catalog_url():
|
||||
r = requests.get('https://www.karafun.de/karaoke-song-list.html')
|
||||
|
@ -78,6 +78,7 @@ def admin():
|
||||
|
||||
@app.before_first_request
|
||||
def activate_job():
|
||||
helpers.create_data_directory()
|
||||
database.create_entry_table()
|
||||
database.create_song_table()
|
||||
database.create_list_view()
|
||||
|
Loading…
x
Reference in New Issue
Block a user