Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
7a5b96c7
Commit
7a5b96c7
authored
4 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Resolve filepath dynamically.
parent
16b98e64
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/core/state.py
+6
-5
6 additions, 5 deletions
modules/core/state.py
with
6 additions
and
5 deletions
modules/core/state.py
+
6
−
5
View file @
7a5b96c7
...
...
@@ -21,7 +21,7 @@ import logging
from
collections
import
deque
from
modules.base.exceptions
import
NoActiveEntryException
from
modules.base.utils
import
SimpleUtil
from
modules.base.utils
import
SimpleUtil
,
EngineUtil
from
modules.database.model
import
SingleEntry
,
SingleEntryMetaData
,
PlaylistEntry
,
PlaylistEntryMetaData
,
TrackService
...
...
@@ -73,12 +73,12 @@ class PlayerStateService:
return
self
.
entry_history
[
0
]
def
store_trackservice_entry
(
self
,
source
):
def
store_trackservice_entry
(
self
,
filepath
):
"""
Stores the entry identified by the given source in the Track Service.
Args:
source
(String): The
URI
of the currently playing
sourc
e
filepath
(String): The
path
of the currently playing
fil
e
Raises:
(NoActiveEntryException): In case currently nothing is playing
...
...
@@ -90,7 +90,8 @@ class PlayerStateService:
raise
NoActiveEntryException
for
active_entry
in
entries
:
if
active_entry
.
source
==
source
:
base_dir
=
self
.
config
.
get
(
"
audiofolder
"
)
if
EngineUtil
.
uri_to_filepath
(
base_dir
,
active_entry
.
source
)
==
filepath
:
trackservice
=
TrackService
(
active_entry
)
trackservice
.
store
(
add
=
True
,
commit
=
True
)
...
...
@@ -101,7 +102,7 @@ class PlayerStateService:
found
=
True
if
not
found
:
msg
=
"
Found no entry in the recent history which matches the given source
'
%s
'"
%
(
source
)
msg
=
"
Found no entry in the recent history which matches the given source
'
%s
'"
%
(
filepath
)
self
.
logger
.
critical
(
SimpleUtil
.
red
(
msg
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment