Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add start filter for list endpoint #3489

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

tomik148
Copy link

Add non required "start" filter to list endpoint, works same as in get endpoint but is optional, if not provided endpoint works same as before if is provided only returns segments created after specified datetime.

@aler9
Copy link
Member

aler9 commented Jul 7, 2024

Hello, while the intended feature is quite useful, the implementation is not correct since it works with segments, while the aim of the playback server is abstracting segments and working on top of them. Here's an example: if we have 3 segments, each 1 hour long:

09_00_00.mp4
10_00_00.mp4
11_00_00.mp4

calling /list results in a single entry since segments are concatenated:

[
  {
    "start": "09_00_00",
    "duration": "10800.0"
  }
]

if we call /list?start=09:30:00 with your implementation, the result is

[
  {
    "start": "10:00:00",
    "duration": "7200.0"
  }
]

This is not correct since there's a recording between 9:30 and 10:00, that is part of the segment that is wrongly filtered out. Correct result should be:

[
  {
    "start": "09:30:00",
    "duration": "9000.0"
  }
]

Therefore, try reimplementing the feature, for instance, by hacking FindSegments() and computeDurationAndConcatenate() in order to work with a start date.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants