Exemple #1
0
 def getInfo(self):
   title = utils.toString(self.title_edit.text())
   year = utils.toString(self.year_edit.text())
   genre = utils.toString(self.genre_edit.text()).strip()
   genres = [genre] if genre else []
   part = None if not self.part_check_box.isChecked() else self.part_spin_box.value()
   series = utils.toString(self.series_edit.text()).strip()
   return movie_types.MovieInfo(title, year, genres, series, part)
Exemple #2
0
 def get_config(self):
   data = config.InputConfig()
   data.folder = utils.toString(self.folderEdit.text())
   data.recursive = self.isRecursiveCheckBox.isChecked()
   data.allExtensions = self.anyExtRadioButton.isChecked()
   data.extensions = extension.FileExtensions(utils.toString(self.fileExtensionEdit.text())).extensionString()
   data.allFileSizes = self.anySizeRadioButton.isChecked()
   data.minFileSizeBytes = utils.stringToBytes("{} {}".format(self.sizeSpinBox.value(), 
                                                              self.sizeComboBox.currentText()))
   data.sources = self._holder.get_config()
   return data
Exemple #3
0
 def getConfig(self):
   data = config.InputConfig()
   data.folder = utils.toString(self.folder_edit.text())
   data.recursive = self.is_recursive_check_box.isChecked()
   data.all_extensions = self.any_extension_radio_button.isChecked()
   data.extensions = extension.FileExtensions(utils.toString(self.file_extension_edit.text())).extensionString()
   data.all_file_sizes = self.any_size_radio_button.isChecked()
   data.min_file_size_bytes = utils.stringToBytes("{} {}".format(self.filesize_spin_box.value(),
                                                                 self.filesize_combo_box.currentText()))
   data.sources = self._holder.getConfig()
   return data
Exemple #4
0
 def get_config(self):
   data = config.OutputConfig()
   data.format = utils.toString(self.formatEdit.text())
   data.folder = utils.toString(self.specificDirectoryEdit.text())
   data.useSource = self.useSourceDirectoryRadio.isChecked()
   data.isMove = self.moveRadio.isChecked()
   data.dontOverwrite = self.doNotOverwriteCheckBox.isChecked()
   data.showHelp = self.helpGroupBox.isVisible()
   data.actionSubtitles = self.subtitleCheckBox.isChecked()
   ext = utils.toString(self.subtitleExtensionsEdit.text())
   data.subtitleExtensions = extension.FileExtensions(ext).extensionString()
   return data
Exemple #5
0
 def getConfig(self):
   data = config.OutputConfig()
   data.format = utils.toString(self.format_edit.text())
   data.folder = utils.toString(self.directory_edit.text())
   data.use_source = self.use_source_radio.isChecked()
   data.is_move = self.is_move_radio.isChecked()
   data.dont_overwrite = self.is_no_overwrite_check_box.isChecked()
   data.show_help = self.help_group_box.isVisible()
   data.action_subtitles = self.subtitle_check_box.isChecked()
   ext = utils.toString(self.subtitle_edit.text())
   data.subtitle_exts = extension.FileExtensions(ext).extensionString()
   return data
Exemple #6
0
  def _saveSettingsConfig(self):
    data = config.MainWindowConfig()
    data.geo = utils.toString(self.saveGeometry().toBase64())
    data.state = utils.toString(self.saveState().toBase64())
    data.mode = self._mode
    data.auto_start = self._auto_start
    data.dont_shows = base_widget.DontShowManager.getConfig()
    self._config_manager.setData("mw", data)

    for module in self._mode_to_module.values():
      for widget in [module.input_widget, module.output_widget, module.work_bench]:
        self._config_manager.setData(widget.config_name, widget.getConfig())
    self._config_manager.saveConfig(self._config_file)
Exemple #7
0
 def getInfo(self):
   search_params = self._search_widget.getSearchParams()
   info = tv_types.SeasonInfo(search_params.show_name, search_params.season_num)
   startIndex = self.index_spin_box.value()
   for i in range(self.episode_table.rowCount()):
     ep_name = self.episode_table.item(i, _TITLE_COLUMN)
     info.episodes.append(tv_types.EpisodeInfo(i + startIndex, utils.toString(ep_name.text())))
   return info
Exemple #8
0
 def getConfig(self):
   ret = config.MovieWorkBenchConfig()
   ret.no_year_as_error = self.require_year_check_box.isChecked()
   ret.no_genre_as_error = self.require_genre_check_box.isChecked()
   ret.duplicate_as_error = self.require_non_duplicate_box.isChecked()
   ret.state = utils.toString(self.movie_view.horizontalHeader().saveState().toBase64())
   #TODO: ret.series_list = self._change_movie_widget.getSeriesList()
   return ret
Exemple #9
0
 def _updatePreviewText(self):
   prefixText = "Example"
   info = self._helper.exampleInfo
   if self._helper.previewInfo:
     prefixText = "Preview"
     info = self._helper.previewInfo
   formattedText = self._helper.formatter.getNameFromInfo(utils.toString(self.formatEdit.text()), info)
   color = "red"
   if file_helper.FileHelper.isValidFilename(formattedText):
     color = "gray"
   formattedText = "{}: {}".format(prefixText, file_helper.FileHelper.sanitizeFilename(formattedText))
   self.formatExampleLabel.setText(formattedText)
   self.formatExampleLabel.setStyleSheet("QLabel {{ color: {}; }}".format(color))
Exemple #10
0
 def _updatePreviewText(self):
   """ update preview text based on the currently selected item in the BaseWorkBenchWidget. 
   if no item is selected the preview info is shown 
   """
   prefix_text = "Example"
   info = self._helper.example_info
   if self._helper.preview_info:
     prefix_text = "Preview"
     info = self._helper.preview_info
   formatted_text = self._helper.formatter.getNameFromInfo(utils.toString(self.format_edit.text()), info)
   color = "red"
   if file_helper.FileHelper.isValidFilename(formatted_text):
     color = "gray"
   formatted_text = "{}: {}".format(prefix_text, file_helper.FileHelper.sanitizeFilename(formatted_text))
   self.format_example_label.setText(formatted_text)
   self.format_example_label.setStyleSheet("QLabel {{ color: {}; }}".format(color))
Exemple #11
0
 def getConfig(self):
   ret = config.TvWorkBenchConfig()
   ret.state = utils.toString(self.tv_view.header().saveState().toBase64())
   return ret
Exemple #12
0
 def getSearchParams(self):
   return tv_types.TvSearchParams(utils.toString(self.season_edit.text()), self.season_spin_box.value())
Exemple #13
0
 def accept(self):
   series = utils.toString(self.series_edit.text())
   if series and not series in self._series_list:
     self._series_list.append(series)
     #TODO: self.setSeriesList(self._series_list)
   return super(EditMovieItemWidget, self).accept()
Exemple #14
0
def _leftPad(val, places=2):
    ret = utils.toString(val).zfill(places)
    return ret