mirror of https://gitlab.com/openlp/openlp.git
Merge branch 'issue-1216' into 'master'
Fix file hash not being generated Closes #1216 See merge request openlp/openlp!513
This commit is contained in:
commit
82ef139a2d
|
@ -628,6 +628,8 @@ class ServiceManager(QtWidgets.QWidget, RegistryBase, Ui_ServiceManager, LogMixi
|
|||
continue
|
||||
write_list.append(path_from_tuple)
|
||||
for (audio_path, audio_file_hash) in item['service_item'].background_audio:
|
||||
if not audio_file_hash:
|
||||
audio_file_hash = sha256_file_hash(audio_path)
|
||||
service_path = audio_file_hash + audio_path.suffix
|
||||
audio_path_tuple = (audio_path, service_path)
|
||||
if audio_path_tuple in write_list:
|
||||
|
|
|
@ -28,6 +28,7 @@ from shutil import copyfile
|
|||
|
||||
from PyQt5 import QtCore, QtWidgets, QtGui
|
||||
|
||||
from openlp.core.common import sha256_file_hash
|
||||
from openlp.core.common.applocation import AppLocation
|
||||
from openlp.core.common.i18n import UiStrings, get_natural_key, translate
|
||||
from openlp.core.common.mixins import RegistryProperties
|
||||
|
@ -1095,6 +1096,7 @@ class EditSongForm(QtWidgets.QDialog, Ui_EditSongDialog, RegistryProperties):
|
|||
file_paths.append(file_path)
|
||||
media_file = MediaFile()
|
||||
media_file.file_path = file_path
|
||||
media_file.file_hash = sha256_file_hash(file_path)
|
||||
media_file.type = 'audio'
|
||||
media_file.weight = row
|
||||
self.song.media_files.append(media_file)
|
||||
|
|
Loading…
Reference in New Issue