Shoko.Server/API/v3/Controllers/FileController.cs
/// <summary>
/// Run a file through AVDump and return the result.
/// </summary>
/// <param name="fileID">VideoLocal ID</param>
/// <returns></returns>
Run a file through AVDump and return the result.
Run a file through AVDump and return the result .
[HttpPost("{fileID}/AVDump")]
        public ActionResult<AVDumpResult> AvDumpFile(int fileID)
        {
            if (string.IsNullOrWhiteSpace(ServerSettings.Instance.AniDb.AVDumpKey))
                return BadRequest("Missing AVDump API key");
            var vl = RepoFactory.VideoLocal.GetByID(fileID);
            if (vl == null) return NotFound();
            var file = vl.GetBestVideoLocalPlace(true)?.FullServerPath;
            if (string.IsNullOrEmpty(file)) return this.NoContent();
            var result = AVDumpHelper.DumpFile(file).Replace("\r", "");
            return new AVDumpResult()
            {
                FullOutput = result,
                Ed2k = result.Split('\n').FirstOrDefault(s => s.Trim().Contains("ed2k://"))
            };
        }
[ HttpPost ( " " ) ] public ActionResult < AVDumpResult > AvDumpFile ( int fileID ) { if ( string . IsNullOrWhiteSpace ( ServerSettings . Instance . AniDb . AVDumpKey ) ) return BadRequest ( " " ) ; var vl = RepoFactory . VideoLocal . GetByID ( fileID ) ; if ( vl == null ) return NotFound ( ) ; var file = vl . GetBestVideoLocalPlace ( true ) ? . FullServerPath ; if ( string . IsNullOrEmpty ( file ) ) return this . NoContent ( ) ; var result = AVDumpHelper . DumpFile ( file ) . Replace ( " \r " , " " ) ; return new AVDumpResult ( ) { FullOutput = result , Ed2k = result . Split ( ' \n ' ) . FirstOrDefault ( s => s . Trim ( ) . Contains ( " " ) ) } ; }
Run a file through AVDump and return the result.
Run a file through AVDump and return the result .
None
fileID
int
None