Update use of media_dir following change in Libervia Media:
Libervia Media is now a Python package instead of files to put in a directory to specify in settings. The discovery is now automatic, removing the need for settings and enabling easier installation. Furthermore, it should now work even if the package is zipped. `libervia_media` can now be specified as a dependency for frontends requiring it.
This commit is contained in:
parent
2e7ada2b6d
commit
919cafc68c
1 changed files with 12 additions and 20 deletions
|
|
@ -18,7 +18,6 @@ import sys
|
|||
import os
|
||||
import os.path
|
||||
import json
|
||||
from pathlib import Path
|
||||
from zope.interface import implementer
|
||||
from twisted.names import client as dns_client
|
||||
from twisted.python.procutils import which
|
||||
|
|
@ -28,13 +27,12 @@ from twisted.internet import protocol
|
|||
from twisted.internet import abstract
|
||||
from twisted.internet import error as int_error
|
||||
from twisted.internet import _sslverify
|
||||
from libervia.backend import G
|
||||
from libervia.backend.core.i18n import _, D_
|
||||
from libervia.backend.core.constants import Const as C
|
||||
from libervia.backend.core.log import getLogger
|
||||
from libervia.backend.core import exceptions
|
||||
from libervia.backend.tools.common import async_process
|
||||
from libervia.backend.memory import params
|
||||
from libervia import media
|
||||
|
||||
|
||||
log = getLogger(__name__)
|
||||
|
|
@ -283,8 +281,7 @@ class AndroidPlugin(object):
|
|||
self.am = activity.getSystemService(Context.AUDIO_SERVICE)
|
||||
|
||||
# sound notification
|
||||
media_dir = G.config.common.media_dir
|
||||
assert media_dir is not None
|
||||
media_dir = media.get_path()
|
||||
notif_path = media_dir / "sounds" / "notifications" / "music-box.mp3"
|
||||
self.notif_player = MediaPlayer()
|
||||
self.notif_player.setDataSource(str(notif_path))
|
||||
|
|
|
|||
Loading…
Reference in a new issue