Skip to content

fix: raise an error when duration is non-zero for video assets#2399

Merged
nicomiguelino merged 3 commits intoScreenly:masterfrom
nicomiguelino:fix-post-assets-v2-ep
Jul 11, 2025
Merged

fix: raise an error when duration is non-zero for video assets#2399
nicomiguelino merged 3 commits intoScreenly:masterfrom
nicomiguelino:fix-post-assets-v2-ep

Conversation

@nicomiguelino
Copy link
Contributor

@nicomiguelino nicomiguelino commented Jul 11, 2025

Issues Fixed

Creating a video asset via POST /api/v2/assets fails and gives the following errors:

{
  “error”: “Invalid file path. Failed to add asset.”
}

As seen in this forum post, the user did two endpoint calls.

The first call (i.e., POST /api/v2/file_asset) was successful.
The second call (POST /api/v2/assets) failed.

The root cause is the non-zero value given to the duration in the request body for POST /api/v2/assets. Take note that a asset is being given a duration similar to the uploaded video's.

Description

This pull request modifies the POST /api/v2/assets endpoint so that it will fail gracefully when a non-zero duration for a video asset is given to the request body.

Checklist

  • I have performed a self-review of my own code.
  • New and existing unit tests pass locally and on CI with my changes.
  • I have done an end-to-end test for Raspberry Pi devices.
  • I have tested my changes for x86 devices.
  • I added a documentation for the changes I have made (when necessary).

@github-project-automation github-project-automation bot moved this to In progress in Anthias Jul 11, 2025
@sonarqubecloud
Copy link

@nicomiguelino nicomiguelino marked this pull request as ready for review July 11, 2025 06:51
@nicomiguelino nicomiguelino requested a review from a team as a code owner July 11, 2025 06:51
@nicomiguelino nicomiguelino merged commit ca1c81b into Screenly:master Jul 11, 2025
8 checks passed
@github-project-automation github-project-automation bot moved this from In progress to Done in Anthias Jul 11, 2025
@nicomiguelino nicomiguelino deleted the fix-post-assets-v2-ep branch July 11, 2025 06:56
@nicomiguelino nicomiguelino self-assigned this Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

1 participant