mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Refactored imports to avoid DB startup for unrelated tasks
This commit is contained in:
parent
45d481b1ed
commit
de5ae6408a
@ -10,7 +10,7 @@ from .setup import setup
|
|||||||
from . import tasks
|
from . import tasks
|
||||||
from .. import __pkginfo__ as info
|
from .. import __pkginfo__ as info
|
||||||
from .. import globalconf
|
from .. import globalconf
|
||||||
from .. import server
|
|
||||||
|
|
||||||
|
|
||||||
def print_header_info():
|
def print_header_info():
|
||||||
@ -88,6 +88,7 @@ def onlysetup():
|
|||||||
def direct():
|
def direct():
|
||||||
print_header_info()
|
print_header_info()
|
||||||
setup()
|
setup()
|
||||||
|
from .. import server
|
||||||
server.run_server()
|
server.run_server()
|
||||||
|
|
||||||
def debug():
|
def debug():
|
||||||
|
@ -4,10 +4,10 @@ import time
|
|||||||
|
|
||||||
from doreah.io import col
|
from doreah.io import col
|
||||||
|
|
||||||
from ...database.sqldb import get_scrobbles
|
|
||||||
|
|
||||||
def export(targetfolder=None):
|
def export(targetfolder=None):
|
||||||
|
|
||||||
|
from ...database.sqldb import get_scrobbles
|
||||||
|
|
||||||
if targetfolder is None:
|
if targetfolder is None:
|
||||||
targetfolder = os.getcwd()
|
targetfolder = os.getcwd()
|
||||||
|
|
||||||
|
@ -2,8 +2,6 @@ import random
|
|||||||
import datetime
|
import datetime
|
||||||
from doreah.io import ask
|
from doreah.io import ask
|
||||||
|
|
||||||
from ...database.sqldb import add_scrobbles
|
|
||||||
|
|
||||||
|
|
||||||
artists = [
|
artists = [
|
||||||
"Chou Tzuyu","Jennie Kim","Kim Seolhyun","Nancy McDonie","Park Junghwa","Hirai Momo","Rosé Park","Laura Brehm","HyunA",
|
"Chou Tzuyu","Jennie Kim","Kim Seolhyun","Nancy McDonie","Park Junghwa","Hirai Momo","Rosé Park","Laura Brehm","HyunA",
|
||||||
@ -69,6 +67,9 @@ def generate_track():
|
|||||||
|
|
||||||
|
|
||||||
def generate(n=200):
|
def generate(n=200):
|
||||||
|
|
||||||
|
from ...database.sqldb import add_scrobbles
|
||||||
|
|
||||||
n = int(n)
|
n = int(n)
|
||||||
|
|
||||||
if ask("Generate random scrobbles?",default=False):
|
if ask("Generate random scrobbles?",default=False):
|
||||||
|
@ -5,7 +5,7 @@ from doreah.io import col, ask, prompt
|
|||||||
|
|
||||||
from ...cleanup import *
|
from ...cleanup import *
|
||||||
from ...globalconf import data_dir
|
from ...globalconf import data_dir
|
||||||
from ...database.sqldb import add_scrobbles
|
|
||||||
|
|
||||||
c = CleanerAgent()
|
c = CleanerAgent()
|
||||||
|
|
||||||
@ -21,6 +21,8 @@ outputs = {
|
|||||||
|
|
||||||
def import_scrobbles(inputf):
|
def import_scrobbles(inputf):
|
||||||
|
|
||||||
|
from ...database.sqldb import add_scrobbles
|
||||||
|
|
||||||
result = {
|
result = {
|
||||||
"CONFIDENT_IMPORT": 0,
|
"CONFIDENT_IMPORT": 0,
|
||||||
"UNCERTAIN_IMPORT": 0,
|
"UNCERTAIN_IMPORT": 0,
|
||||||
|
Loading…
Reference in New Issue
Block a user