aboutsummaryrefslogtreecommitdiff
path: root/src/backend/tau/api/items.clj
diff options
context:
space:
mode:
authorMiguel Ángel Moreno <mail@migalmoreno.com>2023-01-17 13:17:40 +0100
committerMiguel Ángel Moreno <mail@migalmoreno.com>2023-01-17 13:17:40 +0100
commit81f03c0b449bec1fa60cf2936bfc3f66a5ad58c1 (patch)
treea2a7aa01f61dd71b511dd3729a9f4b28c35b531f /src/backend/tau/api/items.clj
parent5e995881dd0c431ae63b1a50c2d03e59962241f1 (diff)
chore: Rename project
Diffstat (limited to 'src/backend/tau/api/items.clj')
-rw-r--r--src/backend/tau/api/items.clj47
1 files changed, 0 insertions, 47 deletions
diff --git a/src/backend/tau/api/items.clj b/src/backend/tau/api/items.clj
deleted file mode 100644
index 676af3e..0000000
--- a/src/backend/tau/api/items.clj
+++ /dev/null
@@ -1,47 +0,0 @@
-(ns tau.api.items)
-
-(defn get-stream-item
- [stream]
- {:type :stream
- :url (.getUrl stream)
- :name (.getName stream)
- :thumbnail-url (.getThumbnailUrl stream)
- :uploader-name (.getUploaderName stream)
- :uploader-url (.getUploaderUrl stream)
- :uploader-avatar (.getUploaderAvatarUrl stream)
- :upload-date (.getTextualUploadDate stream)
- :short-description (.getShortDescription stream)
- :duration (.getDuration stream)
- :view-count (when-not (= (.getViewCount stream) -1) (.getViewCount stream))
- :uploaded (if (.getUploadDate stream)
- (.. stream (getUploadDate) (offsetDateTime) (toInstant) (toEpochMilli))
- false)
- :verified? (.isUploaderVerified stream)})
-
-(defn get-channel-item
- [channel]
- {:type :channel
- :url (.getUrl channel)
- :name (.getName channel)
- :thumbnail-url (.getThumbnailUrl channel)
- :description (.getDescription channel)
- :subscriber-count (when-not (= (.getSubscriberCount channel) -1) (.getSubscriberCount channel))
- :stream-count (when-not (= (.getStreamCount channel) -1) (.getStreamCount channel))
- :verified? (.isVerified channel)})
-
-(defn get-playlist-item
- [playlist]
- {:type :playlist
- :url (.getUrl playlist)
- :name (.getName playlist)
- :thumbnail-url (.getThumbnailUrl playlist)
- :uploader-name (.getUploaderName playlist)
- :stream-count (when-not (= (.getStreamCount playlist) -1) (.getStreamCount playlist))})
-
-(defn get-items
- [items]
- (map #(case (.name (.getInfoType %))
- "STREAM" (get-stream-item %)
- "CHANNEL" (get-channel-item %)
- "PLAYLIST" (get-playlist-item %))
- items))