Fix query params for the transcoder

This commit is contained in:
Zoe Roux 2024-01-10 12:50:28 +01:00
parent fabafcb78b
commit 8e861faa24

View File

@ -16,9 +16,11 @@
// You should have received a copy of the GNU General Public License // You should have received a copy of the GNU General Public License
// along with Kyoo. If not, see <https://www.gnu.org/licenses/>. // along with Kyoo. If not, see <https://www.gnu.org/licenses/>.
using System.Collections.Generic;
using System.Threading.Tasks; using System.Threading.Tasks;
using AspNetCore.Proxy; using AspNetCore.Proxy;
using Kyoo.Abstractions.Models.Permissions; using Kyoo.Abstractions.Models.Permissions;
using Kyoo.Utils;
using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc;
namespace Kyoo.Core.Api namespace Kyoo.Core.Api
@ -39,10 +41,10 @@ namespace Kyoo.Core.Api
/// <returns>The return value of the transcoder.</returns> /// <returns>The return value of the transcoder.</returns>
[Route("video/{**rest}")] [Route("video/{**rest}")]
[Permission("video", Kind.Read)] [Permission("video", Kind.Read)]
public Task Proxy(string rest) public Task Proxy(string rest, [FromQuery] Dictionary<string, string> query)
{ {
// TODO: Use an env var to configure transcoder:7666. // TODO: Use an env var to configure transcoder:7666.
return this.HttpProxyAsync($"http://transcoder:7666/{rest}"); return this.HttpProxyAsync($"http://transcoder:7666/{rest}" + query.ToQueryString());
} }
} }
} }