implements favorites/playlist deletion

This commit is contained in:
2025-06-11 15:08:17 -07:00
parent 9aa55864f8
commit ce8ece23a5
5 changed files with 133 additions and 51 deletions

View File

@@ -103,6 +103,13 @@ struct API
.post()
}
public func deleteFavorite(mediaURL: String) async throws {
try await request()
.pathString("/favorites/\(mediaURL.uriEncoded())")
.method(.delete)
.execute()
}
public func delete(index: Int) async throws {
try await request()
.path("/playlist/\(index)")
@@ -214,3 +221,10 @@ struct API
}
}
}
extension String
{
func uriEncoded() -> Self {
return addingPercentEncoding(withAllowedCharacters: .urlHostAllowed)!
}
}