mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-06-03 13:44:22 -04:00
reverted dbg code
This commit is contained in:
parent
aea255f910
commit
93adddd7a9
@ -88,14 +88,7 @@ public class LibraryStructureController : BaseJellyfinApiController
|
|||||||
libraryOptions.PathInfos = Array.ConvertAll(paths, i => new MediaPathInfo(i));
|
libraryOptions.PathInfos = Array.ConvertAll(paths, i => new MediaPathInfo(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
await _libraryManager.AddVirtualFolder(name, collectionType, libraryOptions, refreshLibrary).ConfigureAwait(false);
|
||||||
{
|
|
||||||
await _libraryManager.AddVirtualFolder(name, collectionType, libraryOptions, refreshLibrary).ConfigureAwait(false);
|
|
||||||
}
|
|
||||||
catch (System.Exception ex)
|
|
||||||
{
|
|
||||||
return BadRequest(ex.ToString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return NoContent();
|
return NoContent();
|
||||||
}
|
}
|
||||||
@ -106,6 +99,7 @@ public class LibraryStructureController : BaseJellyfinApiController
|
|||||||
/// <param name="name">The name of the folder.</param>
|
/// <param name="name">The name of the folder.</param>
|
||||||
/// <param name="refreshLibrary">Whether to refresh the library.</param>
|
/// <param name="refreshLibrary">Whether to refresh the library.</param>
|
||||||
/// <response code="204">Folder removed.</response>
|
/// <response code="204">Folder removed.</response>
|
||||||
|
/// <response code="404">Folder not found.</response>
|
||||||
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
/// <returns>A <see cref="NoContentResult"/>.</returns>
|
||||||
[HttpDelete]
|
[HttpDelete]
|
||||||
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
[ProducesResponseType(StatusCodes.Status204NoContent)]
|
||||||
@ -113,6 +107,7 @@ public class LibraryStructureController : BaseJellyfinApiController
|
|||||||
[FromQuery] string name,
|
[FromQuery] string name,
|
||||||
[FromQuery] bool refreshLibrary = false)
|
[FromQuery] bool refreshLibrary = false)
|
||||||
{
|
{
|
||||||
|
// TODO: refactor! this relies on an FileNotFound exception to return NotFound when attempting to remove a library that does not exist.
|
||||||
await _libraryManager.RemoveVirtualFolder(name, refreshLibrary).ConfigureAwait(false);
|
await _libraryManager.RemoveVirtualFolder(name, refreshLibrary).ConfigureAwait(false);
|
||||||
|
|
||||||
return NoContent();
|
return NoContent();
|
||||||
|
@ -77,7 +77,7 @@ public sealed class LibraryStructureControllerTests : IClassFixture<JellyfinAppl
|
|||||||
};
|
};
|
||||||
|
|
||||||
using var createResponse = await client.PostAsJsonAsync("Library/VirtualFolders?name=test&refreshLibrary=true", createBody, _jsonOptions);
|
using var createResponse = await client.PostAsJsonAsync("Library/VirtualFolders?name=test&refreshLibrary=true", createBody, _jsonOptions);
|
||||||
Assert.True(createResponse.StatusCode == HttpStatusCode.NoContent, $"Error: {await createResponse.Content.ReadAsStringAsync()}");
|
Assert.Equal(HttpStatusCode.NoContent, createResponse.StatusCode);
|
||||||
|
|
||||||
using var response = await client.GetAsync("Library/VirtualFolders");
|
using var response = await client.GetAsync("Library/VirtualFolders");
|
||||||
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
Assert.Equal(HttpStatusCode.OK, response.StatusCode);
|
||||||
@ -120,6 +120,6 @@ public sealed class LibraryStructureControllerTests : IClassFixture<JellyfinAppl
|
|||||||
client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client));
|
client.DefaultRequestHeaders.AddAuthHeader(_accessToken ??= await AuthHelper.CompleteStartupAsync(client));
|
||||||
|
|
||||||
using var response = await client.DeleteAsync("Library/VirtualFolders?name=test&refreshLibrary=true");
|
using var response = await client.DeleteAsync("Library/VirtualFolders?name=test&refreshLibrary=true");
|
||||||
Assert.True(response.StatusCode == HttpStatusCode.NoContent, "DeleteFailed: " + await response.Content.ReadAsStringAsync());
|
Assert.Equal(HttpStatusCode.NoContent, response.StatusCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user