mirror of
https://github.com/krateng/maloja.git
synced 2023-08-10 21:12:55 +03:00
Added confirmation prompt to random generation
This commit is contained in:
parent
3108b368ef
commit
5d582d39aa
@ -11,8 +11,6 @@ def loadexternal(filename):
|
|||||||
print("File could not be found.")
|
print("File could not be found.")
|
||||||
return
|
return
|
||||||
|
|
||||||
print("Please wait...")
|
|
||||||
|
|
||||||
from .importer import import_scrobbles
|
from .importer import import_scrobbles
|
||||||
imported,failed,warning = import_scrobbles(filename)
|
imported,failed,warning = import_scrobbles(filename)
|
||||||
print("Successfully imported",imported,"scrobbles!")
|
print("Successfully imported",imported,"scrobbles!")
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import random
|
import random
|
||||||
import datetime
|
import datetime
|
||||||
|
from doreah.io import ask
|
||||||
|
|
||||||
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",
|
||||||
@ -65,12 +66,14 @@ def generate_track():
|
|||||||
|
|
||||||
|
|
||||||
def generate(targetfile):
|
def generate(targetfile):
|
||||||
with open(targetfile,"a") as fd:
|
if ask("Generate random scrobbles?",default=False):
|
||||||
for _ in range(200):
|
with open(targetfile,"a") as fd:
|
||||||
track = generate_track()
|
for _ in range(200):
|
||||||
for _ in range(random.randint(1, 50)):
|
track = generate_track()
|
||||||
timestamp = random.randint(1, int(datetime.datetime.now().timestamp()))
|
for _ in range(random.randint(1, 50)):
|
||||||
|
timestamp = random.randint(1, int(datetime.datetime.now().timestamp()))
|
||||||
|
|
||||||
entry = "\t".join([str(timestamp),"␟".join(track['artists']),track['title'],"-"])
|
entry = "\t".join([str(timestamp),"␟".join(track['artists']),track['title'],"-"])
|
||||||
fd.write(entry)
|
fd.write(entry)
|
||||||
fd.write("\n")
|
fd.write("\n")
|
||||||
|
print("Done!")
|
||||||
|
Loading…
Reference in New Issue
Block a user