This commit is contained in:
jr-k 2024-07-21 02:27:03 +02:00
parent 321dd1929f
commit ca32c6e491
2 changed files with 10 additions and 7 deletions

View File

@ -49,6 +49,7 @@ class ContentController(ObController):
working_folder_path, working_folder = self.get_working_folder() working_folder_path, working_folder = self.get_working_folder()
slides_with_content = self._model_store.slide().get_all_indexed(attribute='content_id', multiple=True) slides_with_content = self._model_store.slide().get_all_indexed(attribute='content_id', multiple=True)
external_storages = self._model_store.external_storage().list_usb_storage_devices() external_storages = self._model_store.external_storage().list_usb_storage_devices()
print(external_storages[0] if len(external_storages) > 0 else 'none')
return render_template( return render_template(
'slideshow/contents/list.jinja.html', 'slideshow/contents/list.jinja.html',

View File

@ -136,11 +136,12 @@ class PlayerController(ObController):
slide['location'] = content['location'] slide['location'] = content['location']
slide['type'] = content['type'] slide['type'] = content['type']
if slide['type'] == ContentType.EXTERNAL_STORAGE.value: if slide['type'] == ContentType.EXTERNAL_STORAGE.value:
mount_point_dir = Path(slide['location']) mount_point_dir = Path(slide['location'])
if mount_point_dir.is_dir(): if True: #mount_point_dir.is_dir():
for file in mount_point_dir.iterdir(): for file in [Path('/Volumes/ESD-USB/obscreen/test/autumn.jpg'), Path('/Volumes/ESD-USB/obscreen/test/soundonly.jpg')]: #mount_point_dir.iterdir():
if file.is_file() and not file.stem.startswith('.'): # if file.is_file() and not file.stem.startswith('.'):
slide['type'] = ContentType.guess_content_type_file(str(file.resolve())).value slide['type'] = ContentType.guess_content_type_file(str(file.resolve())).value
slide['location'] = "file://{}".format(str(file.resolve())) slide['location'] = "file://{}".format(str(file.resolve()))
slide['name'] = file.stem slide['name'] = file.stem
@ -148,6 +149,7 @@ class PlayerController(ObController):
else: else:
self._feed_playlist(playlist_loop, playlist_notifications, slide) self._feed_playlist(playlist_loop, playlist_notifications, slide)
playlists = { playlists = {
'playlist_id': playlist.id if playlist else None, 'playlist_id': playlist.id if playlist else None,
'time_sync': playlist.time_sync if playlist else False, 'time_sync': playlist.time_sync if playlist else False,