Remove bbolt database dependency
Replaced bbolt-based database handling with Fyne built-in preferences for storing application settings. Deleted migration logic, database initialization, and error handling related to bbolt, simplifying the codebase and reducing external dependencies.
This commit is contained in:
@@ -61,9 +61,9 @@ func (h ConvertorHandler) MainConvertor() {
|
||||
}
|
||||
|
||||
func (h ConvertorHandler) FfPathSelection() {
|
||||
ffmpeg, _ := h.convertorRepository.GetPathFfmpeg()
|
||||
ffprobe, _ := h.convertorRepository.GetPathFfprobe()
|
||||
ffplay, _ := h.convertorRepository.GetPathFfplay()
|
||||
ffmpeg := h.convertorRepository.GetPathFfmpeg()
|
||||
ffprobe := h.convertorRepository.GetPathFfprobe()
|
||||
ffplay := h.convertorRepository.GetPathFfplay()
|
||||
h.convertorView.SelectFFPath(ffmpeg, ffprobe, ffplay, h.saveSettingFFPath, h.MainConvertor, h.downloadFFmpeg)
|
||||
}
|
||||
|
||||
@@ -122,9 +122,9 @@ func (h ConvertorHandler) checkingFFPathUtilities() bool {
|
||||
if ffplayChecking == false {
|
||||
continue
|
||||
}
|
||||
_, _ = h.convertorRepository.SavePathFfmpeg(item.FFmpeg)
|
||||
_, _ = h.convertorRepository.SavePathFfprobe(item.FFprobe)
|
||||
_, _ = h.convertorRepository.SavePathFfplay(item.FFplay)
|
||||
_ = h.convertorRepository.SavePathFfmpeg(item.FFmpeg)
|
||||
_ = h.convertorRepository.SavePathFfprobe(item.FFprobe)
|
||||
_ = h.convertorRepository.SavePathFfplay(item.FFplay)
|
||||
return true
|
||||
}
|
||||
|
||||
@@ -156,9 +156,9 @@ func (h ConvertorHandler) saveSettingFFPath(ffmpegPath string, ffprobePath strin
|
||||
return errors.New(errorText)
|
||||
}
|
||||
|
||||
_, _ = h.convertorRepository.SavePathFfmpeg(ffmpegPath)
|
||||
_, _ = h.convertorRepository.SavePathFfprobe(ffprobePath)
|
||||
_, _ = h.convertorRepository.SavePathFfplay(ffplayPath)
|
||||
_ = h.convertorRepository.SavePathFfmpeg(ffmpegPath)
|
||||
_ = h.convertorRepository.SavePathFfprobe(ffprobePath)
|
||||
_ = h.convertorRepository.SavePathFfplay(ffplayPath)
|
||||
|
||||
h.MainConvertor()
|
||||
|
||||
|
@@ -28,9 +28,9 @@ func NewMainHandler(
|
||||
}
|
||||
|
||||
func (h MainHandler) Start() {
|
||||
language, err := h.localizerRepository.GetCode()
|
||||
if err != nil {
|
||||
err = h.app.GetLocalizerService().SetCurrentLanguageByCode(lang.SystemLocale().LanguageString())
|
||||
language := h.localizerRepository.GetCode()
|
||||
if len(language) == 0 {
|
||||
err := h.app.GetLocalizerService().SetCurrentLanguageByCode(lang.SystemLocale().LanguageString())
|
||||
if err != nil {
|
||||
h.menuHandler.LanguageSelection()
|
||||
return
|
||||
|
@@ -143,7 +143,7 @@ func (h MenuHandler) openAbout() {
|
||||
|
||||
func (h MenuHandler) LanguageSelection() {
|
||||
h.localizerView.LanguageSelection(func(lang kernel.Lang) {
|
||||
_, _ = h.localizerRepository.Save(lang.Code)
|
||||
_ = h.localizerRepository.Save(lang.Code)
|
||||
h.convertorHandler.MainConvertor()
|
||||
})
|
||||
}
|
||||
@@ -154,10 +154,7 @@ func (h MenuHandler) settingsSelection() {
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_, err = h.localizerRepository.Save(setting.Language.Code)
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
_ = h.localizerRepository.Save(setting.Language.Code)
|
||||
|
||||
err = h.themeService.SetCurrentTheme(setting.ThemeInfo)
|
||||
if err != nil {
|
||||
|
Reference in New Issue
Block a user