~amk/public-inbox

2 2

Add option http only subsonic host

Philippe Beliveau <pm@pbeliveau.me>
Details
Message ID
<87tuk1vyk0.fsf@pbeliveau.me>
DKIM signature
missing
Download raw message
Hi there,

My local subsonic gonic instance is only exposed to the LAN. I don't use
a certificate for it. Currently the URL for the subsonic-host is
appended to 'https://' :

> (defun subsonic-build-url (endpoint extra-query)
>   "Build a valid subsonic url for a given ENDPOINT.
> EXTRA-QUERY is used for any extra query parameters"
>   (if subsonic-auth
>       (concat "https://"

Could there be a defcustom to toggle https/http? Something like:

> (defgroup subsonic-ssl "https"
>   "Customization group for mpv."
>   :type 'string
>   :group 'subsonic)

and the function to build the url would be changed to:

> (defun subsonic-build-url (endpoint extra-query)
>   "Build a valid subsonic url for a given ENDPOINT.
> EXTRA-QUERY is used for any extra query parameters"
>   (if subsonic-auth
>       (concat subsonic-ssl
>               "://"
>               (plist-get subsonic-auth :host)
>               "/rest" endpoint
>               (subsonic-alist->query (append `(("u" . ,(plist-get subsonic-auth :user))
>                                                ("p" . ,(funcall (plist-get subsonic-auth :secret)))
>                                                ("c" . "ElSonic")
>                                                ("v" . "1.16.0")
>                                                ("f" . "json"))
>                                              extra-query)))
>     (error "Failed to load .authinfo, please provide auth configuration for
> subsonic, and ensure subsonic-host is set correctly")))

All a suggestion.

Thanks for the very useful package.

--
Philippe
Details
Message ID
<877dgw9i52.fsf@amk.ie>
In-Reply-To
<87tuk1vyk0.fsf@pbeliveau.me> (view parent)
DKIM signature
missing
Download raw message
Philippe Beliveau <pm@pbeliveau.me> writes:

> Hi there,
>
> My local subsonic gonic instance is only exposed to the LAN. I don't use
> a certificate for it. Currently the URL for the subsonic-host is
> appended to 'https://' :
>
>> (defun subsonic-build-url (endpoint extra-query)
>>   "Build a valid subsonic url for a given ENDPOINT.
>> EXTRA-QUERY is used for any extra query parameters"
>>   (if subsonic-auth
>>       (concat "https://"
>
> Could there be a defcustom to toggle https/http? Something like:
>
>> (defgroup subsonic-ssl "https"
>>   "Customization group for mpv."
>>   :type 'string
>>   :group 'subsonic)
>
> and the function to build the url would be changed to:
>
>> (defun subsonic-build-url (endpoint extra-query)
>>   "Build a valid subsonic url for a given ENDPOINT.
>> EXTRA-QUERY is used for any extra query parameters"
>>   (if subsonic-auth
>>       (concat subsonic-ssl
>>               "://"
>>               (plist-get subsonic-auth :host)
>>               "/rest" endpoint
>>               (subsonic-alist->query (append `(("u" . ,(plist-get subsonic-auth :user))
>>                                                ("p" . ,(funcall (plist-get subsonic-auth :secret)))
>>                                                ("c" . "ElSonic")
>>                                                ("v" . "1.16.0")
>>                                                ("f" . "json"))
>>                                              extra-query)))
>>     (error "Failed to load .authinfo, please provide auth configuration for
>> subsonic, and ensure subsonic-host is set correctly")))
>
> All a suggestion.
>
> Thanks for the very useful package.
>
> --
> Philippe

Hi Philippe,

Thanks for the suggestion!  I've added a defcustom, however I've used a
boolean rather than a string.

Hope it works as expected for you!

Alex
Philippe Beliveau <pm@pbeliveau.me>
Details
Message ID
<87v94ftv2b.fsf@pbeliveau.me>
In-Reply-To
<877dgw9i52.fsf@amk.ie> (view parent)
DKIM signature
missing
Download raw message
It works great! Thanks.

-- 
Philippe
PGP Fingerprint: 0x9E66C45D0B0AF826
Reply to thread Export thread (mbox)