Fixed Bug in Importing Tags

Fixed a bug where imported tags were not considered if they were implied by any other tag in the whole database.
Also made the image author link clickable and open the URL with QDesktopServices
dev
Peery 3 years ago
parent af671102d5
commit e45106cd2c

@ -129,7 +129,15 @@ class ArtNetManager:
result = self.db_connection.get_tag_impliers(tag)
if len(result) != 0: # tag is implied by some other tag
continue
skip = False
for implier_tag_id in result:
implier_tag_id, implier_tag_name, _, _ = self.db_connection.get_tag_by_ID(implier_tag_id)[0]
if implier_tag_name.strip() in scraped_tags:
skip = True
break
if skip: # skipping the current tag as it is implied by another tag
continue
result = self.db_connection.get_tag_aliases_by_name(tag)
if len(result) != 0: # tag is already tagged by an alias

@ -72,7 +72,9 @@ class Window(QtWidgets.QMainWindow):
self.ui.prev_unknown_image_button.clicked.connect(self.on_prev_unknown_image_clicked)
self.ui.next_unknown_image_button.clicked.connect(self.on_next_unknown_image_clicked)
self.ui.delete_button.clicked.connect(self.on_delete_image_clicked)
self.ui.link_label.linkActivated.connect(self.on_link_label_activated)
self.ui.image_author_label.linkActivated.connect(self.on_image_author_label_activated)
self.ui.presence_docker_button.clicked.connect(self.toggle_presence_docker)
@ -1045,4 +1047,8 @@ class Window(QtWidgets.QMainWindow):
def on_link_label_activated(self, link: str):
print("Source link activated!", link)
QDesktopServices.openUrl(QUrl(link))
def on_image_author_label_activated(self, link: str):
print("Image author link activated!", link)
QDesktopServices.openUrl(QUrl(link))
Loading…
Cancel
Save