Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Room Park Android
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Vladislav Bogdashkin
Room Park Android
Commits
296ca215
Commit
296ca215
authored
Dec 18, 2019
by
Vladislav Bogdashkin
🎣
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix albums right join db issue
parent
5aee3fcb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
4 deletions
+9
-4
AlbumsRepository.kt
...to/visual/roompark/data/data_provider/AlbumsRepository.kt
+1
-1
IDb.kt
...ava/com/biganto/visual/roompark/data/repository/db/IDb.kt
+1
-1
RequeryRepository.kt
.../roompark/data/repository/db/requrey/RequeryRepository.kt
+5
-2
ScreenPresenter.kt
...al/roompark/presentation/screen/albums/ScreenPresenter.kt
+2
-0
No files found.
app/src/main/java/com/biganto/visual/roompark/data/data_provider/AlbumsRepository.kt
View file @
296ca215
...
@@ -31,6 +31,7 @@ class AlbumsContractModule @Inject constructor(
...
@@ -31,6 +31,7 @@ class AlbumsContractModule @Inject constructor(
override
fun
getProgressAlbumList
(
albumId
:
Int
):
Observable
<
List
<
AlbumPreviewModel
>>
=
override
fun
getProgressAlbumList
(
albumId
:
Int
):
Observable
<
List
<
AlbumPreviewModel
>>
=
fetchAlbums
(
albumId
)
fetchAlbums
(
albumId
)
override
fun
getAlbumPhoto
(
photoId
:
Int
):
Observable
<
PhotoModel
>
{
override
fun
getAlbumPhoto
(
photoId
:
Int
):
Observable
<
PhotoModel
>
{
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
TODO
(
"not implemented"
)
//To change body of created functions use File | Settings | File Templates.
}
}
...
@@ -63,7 +64,6 @@ class AlbumsContractModule @Inject constructor(
...
@@ -63,7 +64,6 @@ class AlbumsContractModule @Inject constructor(
private
val
fetchTopLevelAlbumsDb
=
private
val
fetchTopLevelAlbumsDb
=
db
.
getTopLevelAlbums
()
db
.
getTopLevelAlbums
()
.
toList
()
.
toObservable
()
.
toObservable
()
.
subscribeOn
(
Schedulers
.
io
())
.
subscribeOn
(
Schedulers
.
io
())
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/IDb.kt
View file @
296ca215
...
@@ -18,7 +18,7 @@ interface IDb {
...
@@ -18,7 +18,7 @@ interface IDb {
fun
<
T
:
List
<
Persistable
>
>
blockingUpsert
(
entity
:
T
)
fun
<
T
:
List
<
Persistable
>
>
blockingUpsert
(
entity
:
T
)
fun
userObservableResult
(
uuid
:
Int
):
Observable
<
ReactiveResult
<
UserEntity
>>
fun
userObservableResult
(
uuid
:
Int
):
Observable
<
ReactiveResult
<
UserEntity
>>
fun
fetchArticles
(
feedAlias
:
String
,
pageSize
:
Int
,
startIndex
:
Int
):
Observable
<
ArticleEntity
>
fun
fetchArticles
(
feedAlias
:
String
,
pageSize
:
Int
,
startIndex
:
Int
):
Observable
<
ArticleEntity
>
fun
getTopLevelAlbums
():
Observable
<
ImageAlbumEntity
>
fun
getTopLevelAlbums
():
Single
<
MutableList
<
ImageAlbumEntity
>
>
fun
getChildAlbums
(
parentId
:
Int
):
Observable
<
ImageAlbumEntity
>
fun
getChildAlbums
(
parentId
:
Int
):
Observable
<
ImageAlbumEntity
>
fun
checkIfExistsAlbumJunction
(
albumId
:
Int
,
parentAlbumId
:
Int
):
ImageAlbumJunctionEntity
?
fun
checkIfExistsAlbumJunction
(
albumId
:
Int
,
parentAlbumId
:
Int
):
ImageAlbumJunctionEntity
?
fun
getFeed
(
feedAlias
:
String
):
ReactiveResult
<
FeedEntity
>
fun
getFeed
(
feedAlias
:
String
):
ReactiveResult
<
FeedEntity
>
...
...
app/src/main/java/com/biganto/visual/roompark/data/repository/db/requrey/RequeryRepository.kt
View file @
296ca215
...
@@ -71,9 +71,12 @@ class RequeryRepository @Inject constructor(
...
@@ -71,9 +71,12 @@ class RequeryRepository @Inject constructor(
fetchAll
<
ArticleEntity
>().
where
(
ArticleEntity
.
ID
.
eq
(
id
))
fetchAll
<
ArticleEntity
>().
where
(
ArticleEntity
.
ID
.
eq
(
id
))
.
get
()
.
get
()
override
fun
getTopLevelAlbums
():
Observable
<
ImageAlbumEntity
>
=
override
fun
getTopLevelAlbums
():
Single
<
MutableList
<
ImageAlbumEntity
>
>
=
fetchAll
<
ImageAlbumEntity
>()
fetchAll
<
ImageAlbumEntity
>()
.
get
().
observable
()
.
join
(
ImageAlbumJunctionEntity
::
class
)
.
on
(
ImageAlbumJunctionEntity
.
ALBUM_ID
.
eq
(
ImageAlbumEntity
.
ID
))
.
where
(
ImageAlbumJunctionEntity
.
ALBUM_ID
.
isNull
())
.
get
().
observable
().
toList
()
override
fun
getChildAlbums
(
parentId
:
Int
):
Observable
<
ImageAlbumEntity
>
=
override
fun
getChildAlbums
(
parentId
:
Int
):
Observable
<
ImageAlbumEntity
>
=
store
.
select
(
ImageAlbumEntity
::
class
)
store
.
select
(
ImageAlbumEntity
::
class
)
...
...
app/src/main/java/com/biganto/visual/roompark/presentation/screen/albums/ScreenPresenter.kt
View file @
296ca215
...
@@ -25,9 +25,11 @@ class AlbumsScreenPresenter @Inject constructor(
...
@@ -25,9 +25,11 @@ class AlbumsScreenPresenter @Inject constructor(
override
fun
bindIntents
()
{
override
fun
bindIntents
()
{
val
fetchParents
=
interactor
.
fetchHeaderAlbums
()
val
fetchParents
=
interactor
.
fetchHeaderAlbums
()
.
filter
{
!
it
.
isNullOrEmpty
()
}
.
map
{
AlbumsScreenViewState
.
AlbumsListLoaded
(
it
,
selectedIndex
)
}
.
map
{
AlbumsScreenViewState
.
AlbumsListLoaded
(
it
,
selectedIndex
)
}
val
fetchSelected
=
interactor
.
fetchAlbumPhotos
(
selectedIndex
)
val
fetchSelected
=
interactor
.
fetchAlbumPhotos
(
selectedIndex
)
.
filter
{
!
it
.
isNullOrEmpty
()
}
.
map
{
AlbumsScreenViewState
.
AlbumsSelected
(
it
)}
.
map
{
AlbumsScreenViewState
.
AlbumsSelected
(
it
)}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment