Compare commits
No commits in common. "4b2afe13db0f3a323161b70f35144edce362d406" and "9af4546a11ca683d8c7f2d920c05cc97a963f3d4" have entirely different histories.
4b2afe13db
...
9af4546a11
|
@ -20,14 +20,6 @@ public class VideoStreamController : ControllerBase
|
||||||
private readonly HttpVideoStreamService _videoStreamService;
|
private readonly HttpVideoStreamService _videoStreamService;
|
||||||
private readonly Database.UserManager _userManager;
|
private readonly Database.UserManager _userManager;
|
||||||
|
|
||||||
public class AvailableResolutionsResponse
|
|
||||||
{
|
|
||||||
public int Width { get; set; }
|
|
||||||
public int Height { get; set; }
|
|
||||||
public string Name { get; set; } = string.Empty;
|
|
||||||
public string Value => $"{Width}x{Height}";
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 初始化HTTP视频流控制器
|
/// 初始化HTTP视频流控制器
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
@ -68,40 +60,6 @@ public class VideoStreamController : ControllerBase
|
||||||
return boardId.ToString();
|
return boardId.ToString();
|
||||||
}
|
}
|
||||||
|
|
||||||
private Optional<string> TryGetBoardId()
|
|
||||||
{
|
|
||||||
var userName = User.FindFirstValue(ClaimTypes.Name);
|
|
||||||
if (string.IsNullOrEmpty(userName))
|
|
||||||
{
|
|
||||||
logger.Error("User name not found in claims.");
|
|
||||||
return Optional<string>.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
var db = new AppDataConnection();
|
|
||||||
if (db == null)
|
|
||||||
{
|
|
||||||
logger.Error("Database connection failed.");
|
|
||||||
return Optional<string>.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
var userRet = db.GetUserByName(userName);
|
|
||||||
if (!userRet.IsSuccessful || !userRet.Value.HasValue)
|
|
||||||
{
|
|
||||||
logger.Error("User not found.");
|
|
||||||
return Optional<string>.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
var user = userRet.Value.Value;
|
|
||||||
var boardId = user.BoardID;
|
|
||||||
if (boardId == Guid.Empty)
|
|
||||||
{
|
|
||||||
logger.Error("No board bound to this user.");
|
|
||||||
return Optional<string>.None;
|
|
||||||
}
|
|
||||||
|
|
||||||
return boardId.ToString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 获取 HTTP 视频流服务状态
|
/// 获取 HTTP 视频流服务状态
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
Loading…
Reference in New Issue