fixed file playing and recursion issue in queue looping
This commit is contained in:
parent
3a1ecf9eec
commit
cd579becad
|
|
@ -711,6 +711,8 @@ class Node:
|
||||||
search_type
|
search_type
|
||||||
and not URLRegex.BASE_URL.match(query)
|
and not URLRegex.BASE_URL.match(query)
|
||||||
and not re.match(r"(?:[a-z]+?)search:.", query)
|
and not re.match(r"(?:[a-z]+?)search:.", query)
|
||||||
|
and not URLRegex.DISCORD_MP3_URL.match(query)
|
||||||
|
and not path.exists(path.dirname(query))
|
||||||
):
|
):
|
||||||
query = f"{search_type}:{query}"
|
query = f"{search_type}:{query}"
|
||||||
|
|
||||||
|
|
@ -778,7 +780,7 @@ class Node:
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Track(
|
Track(
|
||||||
track_id=track["track"],
|
track_id=track["encoded"],
|
||||||
info={
|
info={
|
||||||
"title": local_file.name,
|
"title": local_file.name,
|
||||||
"author": "Unknown",
|
"author": "Unknown",
|
||||||
|
|
|
||||||
|
|
@ -203,9 +203,13 @@ class Queue(Iterable[Track]):
|
||||||
raise QueueEmpty("No items in the queue.")
|
raise QueueEmpty("No items in the queue.")
|
||||||
|
|
||||||
if self._loop_mode == LoopMode.QUEUE:
|
if self._loop_mode == LoopMode.QUEUE:
|
||||||
# recurse if the item isnt in the queue
|
# set current item to first track in queue if not set already
|
||||||
if self._current_item not in self._queue:
|
# otherwise exception will be raised
|
||||||
self.get()
|
if not self._current_item or self._current_item not in self._queue:
|
||||||
|
if self._queue:
|
||||||
|
item = self._queue[0]
|
||||||
|
else:
|
||||||
|
raise QueueEmpty("No items in the queue.")
|
||||||
|
|
||||||
# set current item to first track in queue if not set already
|
# set current item to first track in queue if not set already
|
||||||
if not self._current_item:
|
if not self._current_item:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue