2024-12-28 18:12:59 +01:00
|
|
|
#!/usr/bin/python3
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import argparse
|
|
|
|
from main import Wobuzz
|
2024-12-28 20:41:18 +01:00
|
|
|
from player.playlist import Playlist
|
2024-12-28 18:12:59 +01:00
|
|
|
|
|
|
|
|
|
|
|
description = "A music player made by The Wobbler."
|
|
|
|
|
|
|
|
parser = argparse.ArgumentParser(description=description)
|
|
|
|
|
|
|
|
parser.add_argument("track", nargs="*", help="Plays audio files the from given paths.", metavar="TRACKS")
|
|
|
|
parser.add_argument("-p", "--playlist", help="Imports a playlist from the given path.", metavar="PLAYLIST_PATH")
|
|
|
|
|
|
|
|
arguments = parser.parse_args()
|
|
|
|
|
|
|
|
app = Wobuzz()
|
|
|
|
|
|
|
|
if arguments.playlist:
|
2024-12-28 20:41:18 +01:00
|
|
|
app.library.temporary_playlist.load_from_m3u(arguments.playlist)
|
2024-12-28 18:12:59 +01:00
|
|
|
|
|
|
|
if arguments.track:
|
2024-12-28 20:41:18 +01:00
|
|
|
app.library.temporary_playlist.load_from_paths(arguments.track)
|
|
|
|
|
|
|
|
app.player.current_playlist = app.library.temporary_playlist
|
|
|
|
app.library.create_playlist_views()
|
2024-12-28 18:12:59 +01:00
|
|
|
|
|
|
|
sys.exit(app.qt_app.exec())
|
|
|
|
|