Skip to content
This repository has been archived by the owner on Mar 14, 2020. It is now read-only.

Commit

Permalink
Fixed default language issues;
Browse files Browse the repository at this point in the history
Resolves #140
  • Loading branch information
twiddli committed Mar 11, 2016
1 parent 3de9cdc commit 503fe38
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 8 deletions.
4 changes: 2 additions & 2 deletions version/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,8 +407,8 @@ def show_in_library(self):
fetch_instance.FINISHED.connect(done)
fetch_instance.FINISHED.connect(metadata_spinner.before_hide)
thread.finished.connect(thread.deleteLater)
thread.start()
#fetch_instance.auto_web_metadata()
#thread.start()
fetch_instance.auto_web_metadata()
metadata_spinner.show()
else:
self.notif_bubble.update_text("Oops!", "Auto metadata fetcher is already running...")
Expand Down
11 changes: 8 additions & 3 deletions version/gallerydialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ def _find_combobox_match(self, combobox, key, default):
f_index = combobox.findText(key, Qt.MatchFixedString)
if f_index != -1:
combobox.setCurrentIndex(f_index)
return True
else:
combobox.setCurrentIndex(default)
return False

def setGallery(self, gallery):
"To be used for when editing a gallery"
Expand All @@ -225,9 +227,12 @@ def setGallery(self, gallery):
self.tags_edit.setText(utils.tag_to_string(gallery.tags))


self._find_combobox_match(self.lang_box, gallery.language, 2)
self._find_combobox_match(self.type_box, gallery.type, 0)
self._find_combobox_match(self.status_box, gallery.status, 0)
if not self._find_combobox_match(self.lang_box, gallery.language, 1):
self._find_combobox_match(self.lang_box, app_constants.G_DEF_LANGUAGE, 1)
if not self._find_combobox_match(self.type_box, gallery.type, 0):
self._find_combobox_match(self.type_box, app_constants.G_DEF_TYPE, 0)
if not self._find_combobox_match(self.status_box, gallery.status, 0):
self._find_combobox_match(self.status_box, app_constants.G_DEF_STATUS, 0)

gallery_pub_date = "{}".format(gallery.pub_date).split(' ')
try:
Expand Down
5 changes: 2 additions & 3 deletions version/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -874,7 +874,7 @@ def tags_in_list(br_tags):
import re as regex
def title_parser(title):
"Receives a title to parse. Returns dict with 'title', 'artist' and language"
" ".join(title.split())
title = " ".join(title.split())
if '/' in title:
try:
title = os.path.split(title)[1]
Expand Down Expand Up @@ -906,9 +906,8 @@ def title_parser(title):
break
else:
parsed_title['language'] = app_constants.G_DEF_LANGUAGE

except IndexError:
pass
parsed_title['language'] = app_constants.G_DEF_LANGUAGE

t = title
for x in a:
Expand Down

0 comments on commit 503fe38

Please sign in to comment.