Only open Wikipedia for songs
This commit is contained in:
parent
a6a0b905d8
commit
35f2b9629b
@ -501,29 +501,25 @@ class Window(QMainWindow, Ui_MainWindow):
|
|||||||
|
|
||||||
def song_info_search(self):
|
def song_info_search(self):
|
||||||
"""
|
"""
|
||||||
Open browser tabs for Wikipedia and Songfacts, searching for
|
Open browser tabs for Wikipedia, searching for
|
||||||
the first that exists of:
|
the first that exists of:
|
||||||
- selected track
|
- selected track
|
||||||
- current track
|
|
||||||
- next track
|
- next track
|
||||||
|
- current track
|
||||||
"""
|
"""
|
||||||
|
|
||||||
title = self.visible_playlist_tab().get_selected_title()
|
title = self.visible_playlist_tab().get_selected_title()
|
||||||
if not title:
|
|
||||||
if self.current_track:
|
|
||||||
title = self.current_track.title
|
|
||||||
if not title:
|
if not title:
|
||||||
if self.next_track:
|
if self.next_track:
|
||||||
title = self.next_track.title
|
title = self.next_track.title
|
||||||
|
if not title:
|
||||||
|
if self.current_track:
|
||||||
|
title = self.current_track.title
|
||||||
if title:
|
if title:
|
||||||
# Wikipedia
|
# Wikipedia
|
||||||
str = urllib.parse.quote_plus(title)
|
str = urllib.parse.quote_plus(title)
|
||||||
url = f"https://www.wikipedia.org/w/index.php?search={str}"
|
url = f"https://www.wikipedia.org/w/index.php?search={str}"
|
||||||
webbrowser.open(url, new=2)
|
webbrowser.open(url, new=2)
|
||||||
# Songfacts
|
|
||||||
slug = slugify(title, replacements=([["'", ""]]))
|
|
||||||
url = f"https://www.songfacts.com/search/songs/{slug}"
|
|
||||||
webbrowser.open(url, new=2)
|
|
||||||
|
|
||||||
def stop(self):
|
def stop(self):
|
||||||
"Stop playing immediately"
|
"Stop playing immediately"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user