Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
backend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Package registry
Container registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
videoag
backend
Commits
4ec90da2
Commit
4ec90da2
authored
2 months ago
by
Simon Künzel
Browse files
Options
Downloads
Patches
Plain Diff
Fix Sorter sorting unknown file formats
parent
e244a192
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
job_controller/jobs/source_file_sorter/job.py
+7
-14
7 additions, 14 deletions
job_controller/jobs/source_file_sorter/job.py
with
7 additions
and
14 deletions
job_controller/jobs/source_file_sorter/job.py
+
7
−
14
View file @
4ec90da2
...
...
@@ -15,11 +15,10 @@ from videoag_common.objects.medium import SorterFileStatus
logger
=
logging
.
getLogger
(
__name__
)
# TODO more?
# List of formats which can be automatically sorted because we can detect weather they are fully uploaded
_AUTOMATIC_SORT_FILE_FORMATS
=
[
"
mp4
"
,
"
mp3
"
,
"
png
"
,
"
jpg
"
,
"
jpeg
"
,
"
mp4
"
,
"
webm
"
,
"
webp
"
,
"
m4a
"
,
"
m4v
"
,
"
mka
"
,
"
mkv
"
,
"
mts
"
,
"
mp3
"
,
"
ogg
"
,
"
wav
"
,
"
png
"
,
"
jpg
"
,
"
jpeg
"
,
"
gif
"
,
]
_MIN_SECONDS_NO_MODIFICATION
=
videoag_common
.
config
[
"
SORTER_MIN_SECONDS_NO_MODIFICATION
"
]
_SORTER_DIR_NAME
=
videoag_common
.
config
[
"
SORTER_DIR
"
]
...
...
@@ -58,7 +57,9 @@ def _check_file(
if
db_path
in
files_in_sorter_dir
:
file
=
files_in_sorter_dir
[
db_path
]
if
status
==
SorterFileStatus
.
SORTING_UPCOMING
and
file
.
status
==
SorterFileStatus
.
ERROR
:
if
(
status
==
SorterFileStatus
.
SORTING_UPCOMING
and
file
.
status
==
SorterFileStatus
.
ERROR
and
file
.
file_modification_time
==
file_mod_time
):
status
=
SorterFileStatus
.
ERROR
error_message
=
file
.
sorter_error_message
else
:
...
...
@@ -71,15 +72,7 @@ def _check_file(
session
.
add
(
file
)
logger
.
info
(
f
"
Adding new file
{
db_path
}
to database
"
)
sort_now
=
False
if
file
.
force_immediate_sort
:
sort_now
=
True
if
status
==
SorterFileStatus
.
SORTING_UPCOMING
:
sort_now
=
True
if
file
.
file_modification_time
!=
file_mod_time
:
sort_now
=
True
if
sort_now
:
status
=
SorterFileStatus
.
SORTING_UPCOMING
logger
.
info
(
f
"
Status for
{
db_path
}
:
{
status
}
(error:
{
error_message
}
)
"
)
...
...
@@ -90,7 +83,7 @@ def _check_file(
file
.
sorter_error_message
=
error_message
file
.
update_time
=
get_standard_datetime_now
()
if
s
ort_now
:
if
s
tatus
==
SorterFileStatus
.
SORTING_UPCOMING
:
logger
.
info
(
f
"
Queuing
{
db_path
}
to be sorted
"
)
to_sort_file_db_paths
.
append
(
db_path
)
...
...
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