This repository has been archived by the owner on Aug 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 16
Move to Asp.Net Core Web Api #14
Closed
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
using MediaBrowser.Channels.IPTV.Configuration; | ||
using MediaBrowser.Model.MediaInfo; | ||
using System.Linq; | ||
using System.Net.Mime; | ||
using Microsoft.AspNetCore.Http; | ||
using Microsoft.AspNetCore.Mvc; | ||
|
||
namespace MediaBrowser.Channels.IPTV.Api | ||
{ | ||
/// <summary> | ||
/// The IP TV controller. | ||
/// </summary> | ||
[ApiController] | ||
[Route("[controller]")] | ||
[Produces(MediaTypeNames.Application.Json)] | ||
public class IptvController : ControllerBase | ||
{ | ||
/// <summary> | ||
/// Bookmarks a video. | ||
/// </summary> | ||
/// <param name="name">The name.</param> | ||
/// <param name="path">The path.</param> | ||
/// <param name="userId">The user id.</param> | ||
/// <param name="protocol">The <see cref="MediaProtocol"/>.</param> | ||
/// <param name="imagePath">The image path.</param> | ||
/// <response code="204">Bookmark set successfully.</response> | ||
/// <returns>A <see cref="NoContentResult"/> indicting success.</returns> | ||
[HttpPost("Bookmarks")] | ||
[ProducesResponseType(StatusCodes.Status204NoContent)] | ||
public ActionResult SetBookmark( | ||
[FromQuery] string name, | ||
[FromQuery] string path, | ||
[FromQuery] string userId, | ||
[FromQuery] MediaProtocol protocol, | ||
[FromQuery] string imagePath) | ||
{ | ||
var list = Plugin.Instance.Configuration.Bookmarks.ToList(); | ||
list.Add(new Bookmark | ||
{ | ||
UserId = userId, | ||
Name = name, | ||
Image = imagePath, | ||
Path = path, | ||
Protocol = protocol | ||
}); | ||
|
||
Plugin.Instance.Configuration.Bookmarks = list.ToArray(); | ||
|
||
Plugin.Instance.SaveConfiguration(); | ||
return NoContent(); | ||
} | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Endpoint should probably require authentication