aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThanos Apollo <[email protected]>2023-08-04 15:34:35 +0300
committerThanos Apollo <[email protected]>2023-08-04 15:34:35 +0300
commitde4d5b39fc852aa7fba733bbeef5bbb1d003bad6 (patch)
tree6c8443058357bf0e9a35224ee379903c035e7bda
parentbd974652647ddd8a0ecc98053302a97f722f6560 (diff)
Merge yeetube-change-query-url to yeetube-change-platform
yeetube-change-query-url didn't make much sense to exist as a seperated interactive function since there is yeetube-change-platform now, with the option of a custom value for a url.
-rw-r--r--yeetube.el28
1 files changed, 12 insertions, 16 deletions
diff --git a/yeetube.el b/yeetube.el
index aea2772..7455b57 100644
--- a/yeetube.el
+++ b/yeetube.el
@@ -440,17 +440,6 @@ prompt blank to keep the default name."
(when (equal yeetube-download-audio-format "no")
(setq yeetube-download-audio-format nil)))
-(defun yeetube-change-query-url (url)
- "Change `yeetube-query-url' to URL."
- (interactive "sURL:")
- (setq yeetube-query-url url)
- (when (string-prefix-p "localhost" yeetube-query-url)
- (setq yeetube-query-url (concat "http://localhost:" (read-string "Port: "))))
- (unless (or (string-prefix-p "http://" yeetube-query-url)
- (string-prefix-p "https://" yeetube-query-url))
- (setq yeetube-query-url (concat "https://" yeetube-query-url)))
- (when (string-suffix-p "/" yeetube-query-url)
- (setq yeetube-query-url (substring yeetube-query-url 0 -1))))
(defun yeetube-change-platform ()
"Change video platform."
@@ -458,11 +447,18 @@ prompt blank to keep the default name."
(let ((platform (completing-read "Choose video platform: "
'("YouTube" "Invidious" "Localhost" "Custom"))))
(pcase platform
- ("Invidious" (yeetube-change-query-url
- (completing-read "Select Instance: " yeetube-invidious-instances)))
- ("Localhost" (yeetube-change-query-url "localhost"))
- ("YouTube" (yeetube-change-query-url "youtube.com"))
- ("Custom" (yeetube-change-query-url (read-string "URL: "))))))
+ ("Invidious" (setq yeetube-query-url
+ (completing-read "Select Instance: " yeetube-invidious-instances)))
+ ("Localhost" (setq yeetube-query-url "localhost"))
+ ("YouTube" (setq yeetube-query-url "youtube.com"))
+ ("Custom" (setq yeetube-query-url (read-string "URL: ")))))
+ (when (string-prefix-p "localhost" yeetube-query-url)
+ (setq yeetube-query-url (concat "http://localhost:" (read-string "Port: "))))
+ (unless (or (string-prefix-p "http://" yeetube-query-url)
+ (string-prefix-p "https://" yeetube-query-url))
+ (setq yeetube-query-url (concat "https://" yeetube-query-url)))
+ (when (string-suffix-p "/" yeetube-query-url)
+ (setq yeetube-query-url (substring yeetube-query-url 0 -1))))
(defun yeetube-update-info (symbol-name new-value _operation _where)