Skip to content

Commit

Permalink
Merge pull request #371 from stakwork/tt/feature/youtube-search
Browse files Browse the repository at this point in the history
Youtube search
  • Loading branch information
tomastiminskas authored Dec 24, 2021
2 parents 005633a + 059b3d8 commit e4bd55a
Show file tree
Hide file tree
Showing 75 changed files with 998 additions and 400 deletions.
4 changes: 2 additions & 2 deletions settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,8 @@ include ':sphinx:application:network:concepts:concept-socket-io'
include ':sphinx:application:network:features:feature-socket-io'
include ':sphinx:application:network:concepts:tor:concept-network-tor'
include ':sphinx:application:network:features:tor:feature-network-tor'
include ':sphinx:application:network:concepts:queries:concept-network-query-podcast-search'
include ':sphinx:application:network:features:queries:feature-network-query-podcast-search'
include ':sphinx:application:network:concepts:queries:concept-network-query-feed-search'
include ':sphinx:application:network:features:queries:feature-network-query-feed-search'

// Activity
include ':sphinx:activity:hilt-qualifiers'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,18 +76,18 @@ internal class DashboardNavigatorImpl @Inject constructor(
detailDriver.submitNavigationRequest(ToPodcastPlayerScreen(chatId, feedId, feedUrl, currentEpisodeDuration))
}

override suspend fun toVideoFeedScreen(chatId: ChatId, feedUrl: FeedUrl) {
override suspend fun toVideoFeedScreen(chatId: ChatId, feedId: FeedId, feedUrl: FeedUrl) {
detailDriver.submitNavigationRequest(
ToVideoFeedDetailScreen(
chatId, feedUrl
chatId, feedId, feedUrl
)
)
}

override suspend fun toVideoWatchScreen(chatId: ChatId, feedUrl: FeedUrl) {
override suspend fun toVideoWatchScreen(chatId: ChatId, feedId: FeedId, feedUrl: FeedUrl) {
detailDriver.submitNavigationRequest(
ToVideoWatchScreen(
chatId, feedUrl
chatId, feedId, feedUrl
)
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@
<string name="failed_to_reject_member">No se ha podido denegar la solicitud</string>

<string name="newsletter_article">ARTÍCULO NEWSLETTER</string>

<string name="subscribe">SUSCRIBIRSE</string>
<string name="unsubscribe">DESUSCRIBIRSE</string>
<string name="feed_search_following_section">SIGUIENDO</string>
<string name="feed_search_directory_section">DIRECTORIO</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@
<string name="failed_to_reject_member">メンバーを拒否できませんでした</string>

<string name="newsletter_article">NEWSLETTER ARTICLE</string>

<string name="subscribe">SUBSCRIBE</string>
<string name="unsubscribe">UNSUBSCRIBE</string>
<string name="feed_search_following_section">FOLLOWING</string>
<string name="feed_search_directory_section">DIRECTORY</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,9 @@
<string name="failed_to_reject_member">拒絕會員失敗</string>

<string name="newsletter_article">NEWSLETTER ARTICLE</string>

<string name="subscribe">SUBSCRIBE</string>
<string name="unsubscribe">UNSUBSCRIBE</string>
<string name="feed_search_following_section">FOLLOWING</string>
<string name="feed_search_directory_section">DIRECTORY</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -105,4 +105,9 @@
<string name="failed_to_reject_member">Failed to reject member</string>

<string name="newsletter_article">NEWSLETTER ARTICLE</string>

<string name="subscribe">SUBSCRIBE</string>
<string name="unsubscribe">UNSUBSCRIBE</string>
<string name="feed_search_following_section">FOLLOWING</string>
<string name="feed_search_directory_section">DIRECTORY</string>
</resources>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,14 @@ inline fun String.toFeedId(): FeedId? =
inline fun FeedId.youtubeVideoId(): String =
value.replace("yt:video:","")

@Suppress("NOTHING_TO_INLINE")
inline fun FeedId.youtubeFeedIds(): List<FeedId> =
listOf(
this,
FeedId("yt:channel:${value}"),
FeedId("yt:playlist:${value}")
)

@JvmInline
value class FeedId(val value: String) {
init {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ data class FeedItem(
imageUrl?.let {
return it
}
return null
return thumbnailUrlToShow
}

var imageUrlToShow: PhotoUrl? = null
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package chat.sphinx.wrapper_podcast

data class PodcastSearchResult(
data class FeedSearchResult(
val id: String,
val feedType: Long,
val title: String,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package chat.sphinx.wrapper_podcast

data class FeedSearchResultRow(
val feedSearchResult: FeedSearchResult?,
val isSectionHeader: Boolean,
val isFollowingSection: Boolean,
val isLastOnSection: Boolean
)
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,14 @@ data class PodcastEpisode(

var playing: Boolean = false

var imageUrlToShow: PhotoUrl? = null
get() {
image?.let {
return it
}
return null
}

val downloaded: Boolean
get()= localFile != null

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -947,10 +947,8 @@ feedUpsert {
UPDATE feedDbo
SET feed_type = :feed_type,
title = :title,
description = :description,
feed_url = :feed_url,
author = :author,
image_url = :image_url,
owner_url = :owner_url,
link = :link,
date_published = :date_published,
Expand Down Expand Up @@ -1008,6 +1006,11 @@ feedUpsert {
feedGetAll:
SELECT *
FROM feedDbo
ORDER BY id DESC;

feedGetAllSubscribed:
SELECT *
FROM feedDbo
WHERE subscribed = 1
ORDER BY id DESC;

Expand Down Expand Up @@ -1049,11 +1052,21 @@ SELECT *
FROM feedDbo
WHERE id = ?;

feedGetByIds:
SELECT *
FROM feedDbo
WHERE id IN ?;

feedGetAllByTitle:
SELECT *
FROM feedDbo
WHERE subscribed = 1
AND (title LIKE :title);
WHERE (title LIKE :title);

feedGetAllByTitleAndType:
SELECT *
FROM feedDbo
WHERE (title LIKE :title)
AND feed_type = :feed_type;

feedUpdateCurrentItemId:
UPDATE feedDbo
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,11 @@ import chat.sphinx.kotlin_response.Response
import chat.sphinx.kotlin_response.ResponseError
import chat.sphinx.wrapper_chat.Chat
import chat.sphinx.wrapper_chat.ChatAlias
import chat.sphinx.wrapper_chat.ChatHost
import chat.sphinx.wrapper_chat.TribeData
import chat.sphinx.wrapper_common.feed.FeedUrl
import chat.sphinx.wrapper_common.chat.ChatUUID
import chat.sphinx.wrapper_common.dashboard.ChatId
import chat.sphinx.wrapper_common.dashboard.ContactId
import chat.sphinx.wrapper_common.feed.FeedId
import chat.sphinx.wrapper_common.feed.Subscribed
import chat.sphinx.wrapper_feed.Feed
import chat.sphinx.wrapper_meme_server.PublicAttachmentInfo
import chat.sphinx.wrapper_podcast.Podcast
import chat.sphinx.wrapper_podcast.PodcastSearchResultRow
import kotlinx.coroutines.flow.Flow

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,25 +1,34 @@
package chat.sphinx.concept_repository_feed

import chat.sphinx.wrapper_chat.ChatHost
import chat.sphinx.wrapper_common.PhotoUrl
import chat.sphinx.wrapper_common.chat.ChatUUID
import chat.sphinx.wrapper_common.dashboard.ChatId
import chat.sphinx.wrapper_common.feed.FeedId
import chat.sphinx.wrapper_common.feed.FeedType
import chat.sphinx.wrapper_common.feed.FeedUrl
import chat.sphinx.wrapper_common.feed.Subscribed
import chat.sphinx.wrapper_feed.Feed
import chat.sphinx.wrapper_feed.FeedDescription
import chat.sphinx.wrapper_podcast.Podcast
import chat.sphinx.wrapper_podcast.PodcastSearchResultRow
import chat.sphinx.wrapper_podcast.FeedSearchResultRow
import kotlinx.coroutines.flow.Flow

interface FeedRepository {
fun getPodcastByChatId(chatId: ChatId): Flow<Podcast?>
fun getPodcastById(feedId: FeedId): Flow<Podcast?>
fun searchPodcastBy(searchTerm: String): Flow<List<PodcastSearchResultRow>>

fun searchFeedsBy(
searchTerm: String,
feedType: FeedType?,
): Flow<List<FeedSearchResultRow>>

suspend fun updateFeedContent(
chatId: ChatId,
host: ChatHost,
feedUrl: FeedUrl,
searchResultDescription: FeedDescription? = null,
searchResultImageUrl: PhotoUrl? = null,
chatUUID: ChatUUID?,
subscribed: Subscribed,
currentEpisodeId: FeedId?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import chat.sphinx.concept_network_query_invite.NetworkQueryInvite
import chat.sphinx.concept_network_query_lightning.NetworkQueryLightning
import chat.sphinx.concept_network_query_meme_server.NetworkQueryMemeServer
import chat.sphinx.concept_network_query_message.NetworkQueryMessage
import chat.sphinx.concept_network_query_podcast_search.NetworkQueryPodcastSearch
import chat.sphinx.concept_network_query_feed_search.NetworkQueryFeedSearch
import chat.sphinx.concept_network_query_save_profile.NetworkQuerySaveProfile
import chat.sphinx.concept_network_query_subscription.NetworkQuerySubscription
import chat.sphinx.concept_network_query_verify_external.NetworkQueryAuthorizeExternal
Expand Down Expand Up @@ -58,7 +58,7 @@ class SphinxRepositoryAndroid(
networkQueryAuthorizeExternal: NetworkQueryAuthorizeExternal,
networkQuerySaveProfile: NetworkQuerySaveProfile,
networkQuerySubscription: NetworkQuerySubscription,
networkQueryPodcastSearch: NetworkQueryPodcastSearch,
networkQueryFeedSearch: NetworkQueryFeedSearch,
rsa: RSA,
socketIOManager: SocketIOManager,
sphinxNotificationManager: SphinxNotificationManager,
Expand All @@ -83,7 +83,7 @@ class SphinxRepositoryAndroid(
networkQueryAuthorizeExternal,
networkQuerySaveProfile,
networkQuerySubscription,
networkQueryPodcastSearch,
networkQueryFeedSearch,
rsa,
socketIOManager,
sphinxNotificationManager,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ dependencies {
api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-lightning')
api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-message')
api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-authorize-external')
api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-podcast-search')
api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-feed-search')
api project(path: ':sphinx:application:network:concepts:queries:concept-network-query-save-profile')

api project(path: ':sphinx:application:network:concepts:concept-socket-io')
Expand Down
Loading

0 comments on commit e4bd55a

Please sign in to comment.