Start on video integration with web ui

This commit is contained in:
viktorstrate
2020-07-11 16:42:27 +02:00
parent f537b1d608
commit b34115cab0
10 changed files with 169 additions and 89 deletions

View File

@@ -101,6 +101,10 @@ func (r *mediaResolver) Downloads(ctx context.Context, obj *models.Media) ([]*mo
title = "Small"
case url.Purpose == models.PhotoHighRes:
title = "Large"
case url.Purpose == models.VideoThumbnail:
title = "Video thumbnail"
case url.Purpose == models.VideoWeb:
title = "Web optimized video"
}
downloads = append(downloads, &models.MediaDownload{
@@ -158,7 +162,11 @@ func (r *mediaResolver) VideoWeb(ctx context.Context, obj *models.Media) (*model
url, err := models.NewMediaURLFromRow(row)
if err != nil {
return nil, errors.Wrapf(err, "could not query video web-format url (%s)", obj.Path)
if err == sql.ErrNoRows {
return nil, nil
} else {
return nil, errors.Wrapf(err, "could not query video web-format url (%s)", obj.Path)
}
}
return url, nil