forked from Read-Write/Submariner
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Check OpenSubsonic extensions, HTTP POST
- Check for OpenSubsonic extensions. Right now, the only one we check for is HTTP POST support. - Actually support HTTP POST. Most servers support this, but for now, we're being conservative and doing what OS suggests and check for the feature flag. - Refactor the request operation heavily to deal with HTTP POST and deal with URL construction changes because of POST support.
- Loading branch information
1 parent
9359f5d
commit af69327
Showing
9 changed files
with
151 additions
and
70 deletions.
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
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,25 @@ | ||
// | ||
// Array+QueryItem.swift | ||
// Submariner | ||
// | ||
// Created by Calvin Buckley on 2025-01-30. | ||
// | ||
// Copyright (c) 2025 Calvin Buckley | ||
// SPDX-License-Identifier: BSD-3-Clause | ||
// | ||
|
||
import Foundation | ||
|
||
extension Array where Element == URLQueryItem { | ||
// Dictionaries aren't the right fit because the API takes multiple items of same name for an array | ||
// But it does mean that mapping it to a dictionary type access isn't ideal | ||
// As such, first element wins for gets, and append for inserts | ||
subscript(_ key: String) -> String? { | ||
get { | ||
self.first { $0.name == key }?.value | ||
} | ||
set { | ||
self.append(URLQueryItem(name: key, value: newValue)) | ||
} | ||
} | ||
} |
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
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
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
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
Oops, something went wrong.