Skip to content

Commit

Permalink
Various fixes, admin ui for media providers now able to add new provi…
Browse files Browse the repository at this point in the history
…ders.
  • Loading branch information
Layoric committed Oct 9, 2024
1 parent a65dac9 commit 5378462
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,10 @@ async Task DownloadOutputAsync(IMediaTransformProvider aiProvider,
"video/mp4" => "mp4",
"video/webm" => "webm",
"video/ogg" => "ogg",
_ => "webm"
"video/mov" => "mov",
"video/avi" => "avi",
"video/mkv" => "mkv",
_ => "mp4"
};

var imageBytes = await response.Content.ReadAsByteArrayAsync();
Expand Down
2 changes: 1 addition & 1 deletion AiServer.ServiceInterface/VideoServices.cs
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,8 @@ private bool IsVideoFormat(MediaOutputFormat outputFormat)
case MediaOutputFormat.MKV:
case MediaOutputFormat.MOV:
case MediaOutputFormat.WebM:
return true;
case MediaOutputFormat.GIF:
return true;
case MediaOutputFormat.MP3:
case MediaOutputFormat.WAV:
case MediaOutputFormat.FLAC:
Expand Down
2 changes: 1 addition & 1 deletion AiServer.ServiceModel/GenerationAdmin.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public class CreateMediaProvider : ICreateDb<MediaProvider>, IReturn<IdResponse>
public List<string>? Models { get; set; }

[Input(Type = "hidden")]
public int? MediaTypeId { get; set; }
public string MediaTypeId { get; set; }
}

[Tag(Tag.Info)]
Expand Down
9 changes: 6 additions & 3 deletions AiServer/wwwroot/mjs/components/MediaProviders.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -127,8 +127,11 @@ const SelectModels = {
}
return;
} else {
supportedModels.value = Object.keys(props.providerType?.apiModels, [])
qualifiedModelMappings.value = props.providerType?.apiModels
if (props.providerType?.apiModels) {
console.log(props.providerType?.apiModels)
supportedModels.value = Object.keys(props.providerType?.apiModels, [])
qualifiedModelMappings.value = props.providerType?.apiModels
}
}
comfyModels.value = []
isConnectionTested.value = false
Expand Down Expand Up @@ -212,7 +215,7 @@ export default {
<span class="flex flex-1">
<Icon :src="type.icon" class="w-5 h-5 mr-2" />
<span class="flex flex-col">
<span class="block text-sm font-medium text-gray-900">{{type.name}}</span>
<span class="block text-sm font-medium text-gray-900">{{type.id}}</span>
</span>
</span>
<svg v-if="providerType == type.id" class="h-5 w-5 text-indigo-600" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
Expand Down

0 comments on commit 5378462

Please sign in to comment.