Skip to content

Commit

Permalink
Update v1.8
Browse files Browse the repository at this point in the history
  • Loading branch information
afkarxyz authored Jan 14, 2025
1 parent a7f60c5 commit 94ef501
Showing 1 changed file with 32 additions and 1 deletion.
33 changes: 32 additions & 1 deletion Spotizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -684,8 +684,36 @@ def init_ui(self):
self.progress_bar.hide()
self.main_layout.addWidget(self.progress_bar)

bottom_layout = QHBoxLayout()

self.status_label = QLabel("")
self.main_layout.addWidget(self.status_label)
bottom_layout.addWidget(self.status_label, stretch=1)

self.update_button = QPushButton()
icon_path = os.path.join(os.path.dirname(__file__), "update.svg")
if os.path.exists(icon_path):
self.update_button.setIcon(QIcon(icon_path))
self.update_button.setFixedSize(16, 16)
self.update_button.setStyleSheet("""
QPushButton {
border: none;
background: transparent;
}
QPushButton:hover {
background: transparent;
}
""")
self.update_button.setCursor(QCursor(Qt.CursorShape.PointingHandCursor))
self.update_button.setToolTip("Check for Updates")
self.update_button.clicked.connect(self.open_update_page)

bottom_layout.addWidget(self.update_button)

self.main_layout.addLayout(bottom_layout)

def open_update_page(self):
import webbrowser
webbrowser.open('https://github.com/afkarxyz/Spotizer/releases')

def fetch_metadata(self):
url = self.url_input.text().strip()
Expand Down Expand Up @@ -738,6 +766,7 @@ def handle_track_info(self, info):
self.track_widget.show()
self.download_button.show()
self.cancel_button.show()
self.update_button.hide()
self.status_label.clear()

def update_cover_art(self, image_data):
Expand Down Expand Up @@ -782,6 +811,7 @@ def cancel_clicked(self):
self.status_label.clear()
self.track_info = None
self.fetch_button.setEnabled(True)
self.update_button.show()

def clear_form(self):
self.url_input.clear()
Expand All @@ -795,6 +825,7 @@ def clear_form(self):
self.track_widget.hide()
self.input_widget.show()
self.track_info = None
self.update_button.show()

def button_clicked(self):
if self.download_button.text() == "Clear":
Expand Down

0 comments on commit 94ef501

Please sign in to comment.