├── app ├── .gitignore ├── src │ ├── test │ │ ├── resources │ │ │ └── mockito-extensions │ │ │ │ └── org.mockito.plugins.MockMaker │ │ └── java │ │ │ └── com │ │ │ └── ulicae │ │ │ └── cinelog │ │ │ ├── utils │ │ │ └── BusinessPreferenceGetterTest.java │ │ │ ├── network │ │ │ └── TmdbGetterServiceTest.java │ │ │ ├── room │ │ │ └── dto │ │ │ │ └── utils │ │ │ │ └── from │ │ │ │ └── TagFromDtoCreatorTest.java │ │ │ ├── io │ │ │ └── exportdb │ │ │ │ ├── writer │ │ │ │ ├── WishlistCsvExportWriterTest.java │ │ │ │ └── TagCsvExportWriterTest.java │ │ │ │ └── exporter │ │ │ │ └── AsyncCsvExporterTest.java │ │ │ ├── data │ │ │ └── dto │ │ │ │ └── TvShowToWishlistDataDtoBuilderTest.java │ │ │ ├── android │ │ │ └── v2 │ │ │ │ └── fragments │ │ │ │ └── review │ │ │ │ └── edit │ │ │ │ └── WishlistItemDeleterTest.java │ │ │ └── KinoBuilderFromMovieTest.java │ └── main │ │ ├── res │ │ ├── drawable │ │ │ ├── icon.png │ │ │ ├── menu.png │ │ │ ├── add_kino.png │ │ │ ├── add_tag.png │ │ │ ├── add_review.png │ │ │ ├── edit_kino.png │ │ │ ├── save_kino.png │ │ │ ├── feature_graphic.png │ │ │ ├── noimage_purple.png │ │ │ ├── round_eye_grey.png │ │ │ ├── round_eye_purple.png │ │ │ └── feature_graphic_purple.png │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── layout │ │ │ ├── v2_export_host.xml │ │ │ ├── v2_import_host.xml │ │ │ ├── fragment_tag_list.xml │ │ │ ├── fragment_serie_list.xml │ │ │ ├── fragment_movie_list.xml │ │ │ ├── fragment_room_list.xml │ │ │ ├── activity_import_db.xml │ │ │ ├── activity_export_db.xml │ │ │ ├── toolbar.xml │ │ │ ├── fragment_serie_view_episodes.xml │ │ │ ├── fragment_serie_view_general.xml │ │ │ ├── fragment_review_serie_item.xml │ │ │ ├── review_list_year_row.xml │ │ │ ├── nav_header.xml │ │ │ ├── toolbar_new.xml │ │ │ ├── content_export_db.xml │ │ │ ├── fragment_review_movie_item.xml │ │ │ └── tag_item.xml │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ └── styles.xml │ │ ├── xml │ │ │ └── preference_headers.xml │ │ ├── menu │ │ │ ├── menu_review.xml │ │ │ ├── menu_simple.xml │ │ │ └── drawer_view.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── values-v21 │ │ │ └── styles.xml │ │ └── values-night │ │ │ └── styles.xml │ │ └── java │ │ └── com │ │ └── ulicae │ │ └── cinelog │ │ ├── sqlite │ │ ├── NoSuchTableException.java │ │ ├── DbHelper.java │ │ └── KinoReaderContract.java │ │ ├── room │ │ ├── entities │ │ │ ├── ItemEntityType.java │ │ │ ├── ReviewWithEpisodes.java │ │ │ ├── ReviewTagCrossRef.java │ │ │ └── WishlistItem.java │ │ ├── dto │ │ │ ├── data │ │ │ │ ├── WishlistItemType.java │ │ │ │ ├── TvShowToSerieDataDtoBuilder.java │ │ │ │ └── MovieToWishlistDataDtoBuilder.java │ │ │ ├── TmdbItemDto.java │ │ │ ├── ItemDto.java │ │ │ └── utils │ │ │ │ ├── to │ │ │ │ ├── TagToDtoBuilder.java │ │ │ │ └── WishlistItemToDataDtoBuilder.java │ │ │ │ └── from │ │ │ │ ├── TagFromDtoCreator.java │ │ │ │ ├── TagReviewCrossRefFromDtoCreator.java │ │ │ │ ├── SyncEntityFromDtoCreator.java │ │ │ │ └── WishlistFromDtoCreator.java │ │ ├── fragments │ │ │ ├── wishlist │ │ │ │ ├── add │ │ │ │ │ ├── WishlistItemCallback.java │ │ │ │ │ ├── WishlistItemRoomViewHolder.java │ │ │ │ │ ├── WishlistTvRoomResultsAdapter.java │ │ │ │ │ └── WishlistMovieRoomResultsAdapter.java │ │ │ │ └── list │ │ │ │ │ ├── WishlistMovieRoomListFragment.java │ │ │ │ │ └── WishlistSerieRoomListFragment.java │ │ │ └── AddableFragment.java │ │ ├── services │ │ │ ├── AsyncDataTmdbService.java │ │ │ ├── AsyncDataService.java │ │ │ └── AsyncServiceFactory.java │ │ ├── CinelogSchedulers.java │ │ ├── dao │ │ │ ├── RoomDao.java │ │ │ ├── SyncRoomDao.java │ │ │ ├── SyncTmdbSerieEpisodeDao.java │ │ │ ├── SyncWishlistItemDao.java │ │ │ ├── AsyncRoomDao.java │ │ │ ├── TagDao.java │ │ │ ├── TmdbSerieEpisodeDao.java │ │ │ ├── ReviewTagCrossRefDao.java │ │ │ ├── ReviewDao.java │ │ │ └── WishlistItemDao.java │ │ └── converters │ │ │ └── Converters.java │ │ ├── utils │ │ ├── image │ │ │ ├── ImageFinder.java │ │ │ ├── CacheImageDownloaderTaskFactory.java │ │ │ ├── ImageFinderFactory.java │ │ │ ├── ImageNetworkFinder.java │ │ │ ├── ImageCacheFinder.java │ │ │ ├── ImageCacheDownloader.java │ │ │ └── CacheImageDownloaderNetworkTask.java │ │ ├── LocaleWrapper.java │ │ ├── ThemeWrapper.java │ │ ├── BusinessPreferenceGetter.java │ │ ├── ToasterWrapper.java │ │ ├── FileUtilsWrapper.java │ │ └── PreferencesWrapper.java │ │ ├── android │ │ ├── v2 │ │ │ └── fragments │ │ │ │ ├── review │ │ │ │ ├── add │ │ │ │ │ ├── ReviewCreationCallback.java │ │ │ │ │ ├── ReviewItemCallback.java │ │ │ │ │ ├── TmdbMovieResultsAdapter.java │ │ │ │ │ ├── TmdbTvResultsAdapter.java │ │ │ │ │ └── TmdbViewHolder.java │ │ │ │ ├── room │ │ │ │ │ └── list │ │ │ │ │ │ └── ReviewListYearViewHolder.java │ │ │ │ ├── edit │ │ │ │ │ └── WishlistItemDeleter.java │ │ │ │ └── item │ │ │ │ │ └── serie │ │ │ │ │ └── TvEpisodeViewHolder.java │ │ │ │ └── ShareableFragment.java │ │ └── settings │ │ │ └── SettingsActivity.java │ │ ├── io │ │ ├── exportdb │ │ │ ├── SnapshotExporterFactory.java │ │ │ ├── exporter │ │ │ │ ├── CsvExporter.java │ │ │ │ ├── ExporterFactory.java │ │ │ │ ├── WishlistCsvExporterFactory.java │ │ │ │ ├── TagCsvExporterFactory.java │ │ │ │ ├── ReviewCsvExporterFactory.java │ │ │ │ └── AsyncCsvExporter.java │ │ │ ├── AutomaticExportException.java │ │ │ ├── writer │ │ │ │ ├── CsvExportWriter.java │ │ │ │ ├── TagCsvExportWriter.java │ │ │ │ ├── CSVPrinterWrapper.java │ │ │ │ └── WishlistCsvExportWriter.java │ │ │ ├── SnapshotExporter.java │ │ │ └── ExportDb.java │ │ └── importdb │ │ │ ├── ImportException.java │ │ │ ├── CSVFormatWrapper.java │ │ │ ├── ImportInDb.java │ │ │ ├── builder │ │ │ └── TagDtoFromRecordBuilder.java │ │ │ ├── FileReaderGetter.java │ │ │ └── DtoImportCreator.java │ │ └── network │ │ ├── DtoBuilderFromTmdbObject.java │ │ ├── task │ │ ├── NetworkTaskCreator.java │ │ ├── TvNetworkTaskCreator.java │ │ ├── MovieNetworkTaskCreator.java │ │ ├── MovieNetworkTask.java │ │ ├── TvNetworkTask.java │ │ ├── SerieEpisodesNetworkTask.java │ │ └── NetworkTaskManager.java │ │ ├── KinoBuilderFromMovie.java │ │ └── SerieBuilderFromMovie.java └── proguard-rules.pro ├── settings.gradle ├── fastlane └── metadata │ └── android │ ├── en-US │ ├── title.txt │ ├── changelogs │ │ ├── 37.txt │ │ ├── 40.txt │ │ ├── 36.txt │ │ ├── 39.txt │ │ ├── 41.txt │ │ └── 38.txt │ ├── short_description.txt │ ├── images │ │ ├── icon.png │ │ ├── featureGraphic.png │ │ └── phoneScreenshots │ │ │ ├── 1-search.png │ │ │ ├── 2-review.png │ │ │ ├── 3-editreview.png │ │ │ └── 4-searchdarktheme.png │ └── full_description.txt │ ├── fr-FR │ ├── title.txt │ ├── short_description.txt │ └── full_description.txt │ └── pl-PL │ ├── title.txt │ ├── short_description.txt │ └── full_description.txt ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties └── gradle.properties /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/title.txt: -------------------------------------------------------------------------------- 1 | CineLog -------------------------------------------------------------------------------- /fastlane/metadata/android/fr-FR/title.txt: -------------------------------------------------------------------------------- 1 | CinéLog -------------------------------------------------------------------------------- /fastlane/metadata/android/pl-PL/title.txt: -------------------------------------------------------------------------------- 1 | CineLog -------------------------------------------------------------------------------- /app/src/test/resources/mockito-extensions/org.mockito.plugins.MockMaker: -------------------------------------------------------------------------------- 1 | mock-maker-inline -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/37.txt: -------------------------------------------------------------------------------- 1 | * Search / #54 : introduce review and wishlist search -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/drawable/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/menu.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/add_kino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/add_kino.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/add_tag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/add_tag.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/short_description.txt: -------------------------------------------------------------------------------- 1 | Rate and review movies and series you saw. Build your own review database ! -------------------------------------------------------------------------------- /app/src/main/res/drawable/add_review.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/add_review.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/edit_kino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/edit_kino.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/save_kino.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/save_kino.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/feature_graphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/feature_graphic.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/noimage_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/noimage_purple.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/round_eye_grey.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/round_eye_grey.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /fastlane/metadata/android/pl-PL/short_description.txt: -------------------------------------------------------------------------------- 1 | Recenzuj i oceniaj obejrzane filmy i seriale. Stwórz swój własny katalog recenzji! 2 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/round_eye_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/round_eye_purple.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/40.txt: -------------------------------------------------------------------------------- 1 | * Fix bad brasilian resources directory name 2 | * #74: Sorting by viewing date crashes app. 3 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/fastlane/metadata/android/en-US/images/icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/feature_graphic_purple.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/app/src/main/res/drawable/feature_graphic_purple.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/featureGraphic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/fastlane/metadata/android/en-US/images/featureGraphic.png -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/sqlite/NoSuchTableException.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.sqlite; 2 | 3 | public class NoSuchTableException extends Exception { 4 | } 5 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/36.txt: -------------------------------------------------------------------------------- 1 | * Big technical update: rewrite navigation through app 2 | * Bugfix / #55: tags were mistakely added to movies in review list -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/1-search.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/1-search.png -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/2-review.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/2-review.png -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/entities/ItemEntityType.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.entities; 2 | 3 | public enum ItemEntityType { 4 | MOVIE, 5 | SERIE 6 | } 7 | -------------------------------------------------------------------------------- /fastlane/metadata/android/fr-FR/short_description.txt: -------------------------------------------------------------------------------- 1 | Rappelez vous des films et séries que vous avez vus ! Enregistrez des notes, commentaires, et les films & séries que vous voudriez voir. -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/39.txt: -------------------------------------------------------------------------------- 1 | * PR #71 Add Brazilian Portuguese Translation 2 | * PR#67 Update Chinese Strings 3 | * PR #72 / issue #70 fix: avoid NPE on review edit #72 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/41.txt: -------------------------------------------------------------------------------- 1 | * #87: Can't import as not allowed 2 | * #83: Consider using another way to import/export files 3 | * #82: Can't import/export (no permission) 4 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/3-editreview.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/3-editreview.png -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dto/data/WishlistItemType.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dto.data; 2 | 3 | public enum WishlistItemType { 4 | 5 | MOVIE, 6 | SERIE; 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/image/ImageFinder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils.image; 2 | 3 | public interface ImageFinder { 4 | 5 | T getImage(String imagePath); 6 | } 7 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/images/phoneScreenshots/4-searchdarktheme.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Alcidauk/CineLog/HEAD/fastlane/metadata/android/en-US/images/phoneScreenshots/4-searchdarktheme.png -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dto/TmdbItemDto.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dto; 2 | 3 | public interface TmdbItemDto extends ItemDto { 4 | 5 | Long getTmdbKinoId(); 6 | String getTitle(); 7 | 8 | } 9 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Fri May 01 19:12:42 CEST 2020 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-7.3.3-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/v2_export_host.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/v2_import_host.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/review/add/ReviewCreationCallback.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.add; 2 | 3 | import com.ulicae.cinelog.room.dto.KinoDto; 4 | 5 | public interface ReviewCreationCallback { 6 | 7 | void call(KinoDto kinoDto); 8 | } 9 | -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/changelogs/38.txt: -------------------------------------------------------------------------------- 1 | * Search / #64 : Wrong item when opening or deleting a filtered item from the wishlist 2 | * Fix too small fab icon when creating a wishlist item 3 | * #60 Add a label when no tag can be added to a review 4 | * #58 Fix impossible review creation when adding tag -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/fragments/wishlist/add/WishlistItemCallback.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.fragments.wishlist.add; 2 | 3 | import com.ulicae.cinelog.room.dto.data.WishlistDataDto; 4 | 5 | public interface WishlistItemCallback { 6 | void call(WishlistDataDto finalWishlistDataDto); 7 | } 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/review/add/ReviewItemCallback.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.add; 2 | 3 | import com.ulicae.cinelog.room.dto.KinoDto; 4 | 5 | public interface ReviewItemCallback { 6 | 7 | void call(KinoDto kinoDto, int position, boolean inDb); 8 | } 9 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/services/AsyncDataTmdbService.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.services; 2 | 3 | import com.ulicae.cinelog.room.dto.ItemDto; 4 | 5 | import io.reactivex.rxjava3.core.Single; 6 | 7 | public interface AsyncDataTmdbService extends AsyncDataService { 8 | 9 | Single getWithTmdbId(long tmdbId); 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/image/CacheImageDownloaderTaskFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils.image; 2 | 3 | import java.io.File; 4 | 5 | class CacheImageDownloaderTaskFactory { 6 | 7 | CacheImageDownloaderNetworkTask makeTask(File cacheDir, String imagePath){ 8 | return new CacheImageDownloaderNetworkTask(cacheDir, imagePath); 9 | } 10 | 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/image/ImageFinderFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils.image; 2 | 3 | import java.io.File; 4 | 5 | class ImageFinderFactory { 6 | 7 | ImageFinder makeNetworkImageFinder(){ 8 | return new ImageNetworkFinder(); 9 | } 10 | 11 | ImageFinder makeCacheImageFinder(File cacheDir){ 12 | return new ImageCacheFinder(cacheDir); 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/CinelogSchedulers.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room; 2 | 3 | import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers; 4 | import io.reactivex.rxjava3.core.Scheduler; 5 | import io.reactivex.rxjava3.schedulers.Schedulers; 6 | 7 | public class CinelogSchedulers { 8 | 9 | public Scheduler io() { 10 | return Schedulers.io(); 11 | } 12 | 13 | public Scheduler androidMainThread() { 14 | return AndroidSchedulers.mainThread(); 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/image/ImageNetworkFinder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils.image; 2 | 3 | import java.net.MalformedURLException; 4 | import java.net.URL; 5 | 6 | class ImageNetworkFinder implements ImageFinder { 7 | 8 | @Override 9 | public URL getImage(String imagePath) { 10 | try { 11 | return new URL(ImageCacheDownloader.BASE_URL + imagePath); 12 | } catch (MalformedURLException e) { 13 | return null; 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/entities/ReviewWithEpisodes.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.entities; 2 | 3 | import androidx.room.Embedded; 4 | import androidx.room.Relation; 5 | 6 | import java.util.List; 7 | 8 | public class ReviewWithEpisodes { 9 | @Embedded 10 | public Review review; 11 | 12 | @Relation( 13 | parentColumn = "id", 14 | entityColumn = "review_id" 15 | ) 16 | public List episodes; 17 | 18 | public ReviewWithEpisodes(Review review, List episodes) { 19 | this.review = review; 20 | this.episodes = episodes; 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/services/AsyncDataService.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.services; 2 | 3 | import com.ulicae.cinelog.room.dto.ItemDto; 4 | 5 | import java.util.List; 6 | 7 | import io.reactivex.rxjava3.core.Completable; 8 | import io.reactivex.rxjava3.core.Flowable; 9 | import io.reactivex.rxjava3.core.Single; 10 | 11 | public interface AsyncDataService { 12 | 13 | Single createOrUpdate(T dtoObject); 14 | 15 | Single createOrUpdate(List dtos); 16 | 17 | Completable delete(T dtoObject); 18 | 19 | Flowable> findAll(); 20 | 21 | Flowable findById(Long id); 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/ryan/Android/Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/image/ImageCacheFinder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils.image; 2 | 3 | import com.ulicae.cinelog.utils.FileUtilsWrapper; 4 | 5 | import java.io.File; 6 | 7 | class ImageCacheFinder implements ImageFinder { 8 | 9 | private final FileUtilsWrapper fileUtilsWrapper; 10 | 11 | ImageCacheFinder(File cacheDir) { 12 | this(new FileUtilsWrapper(cacheDir)); 13 | } 14 | 15 | private ImageCacheFinder(FileUtilsWrapper fileUtilsWrapper) { 16 | this.fileUtilsWrapper = fileUtilsWrapper; 17 | } 18 | 19 | @Override 20 | public File getImage(String imagePath) { 21 | File posterCacheRoot = fileUtilsWrapper.getFilesDir(); 22 | return fileUtilsWrapper.getFile(posterCacheRoot.getAbsolutePath() + '/' + imagePath); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | -------------------------------------------------------------------------------- /app/src/test/java/com/ulicae/cinelog/utils/BusinessPreferenceGetterTest.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils; 2 | 3 | import android.content.Context; 4 | 5 | import org.junit.Test; 6 | import org.junit.runner.RunWith; 7 | import org.mockito.Mock; 8 | import org.mockito.junit.MockitoJUnitRunner; 9 | 10 | import static org.junit.Assert.*; 11 | import static org.mockito.Mockito.doReturn; 12 | 13 | @RunWith(MockitoJUnitRunner.class) 14 | public class BusinessPreferenceGetterTest { 15 | 16 | @Mock 17 | private PreferencesWrapper preferencesWrapper; 18 | 19 | @Mock 20 | private Context context; 21 | 22 | @Test 23 | public void getAutomaticExport() { 24 | doReturn(true).when(preferencesWrapper).getBooleanPreference(context, "automatic_save", false); 25 | 26 | assertTrue(new BusinessPreferenceGetter(context, preferencesWrapper).getAutomaticExport()); 27 | } 28 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/RoomDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | /** 4 | * CineLog Copyright 2024 Pierre Rognon 5 | *

6 | *

7 | * This file is part of CineLog. 8 | * CineLog is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | *

13 | * CineLog is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | *

18 | * You should have received a copy of the GNU General Public License 19 | * along with CineLog. If not, see . 20 | */ 21 | public interface RoomDao { 22 | 23 | } 24 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/SnapshotExporterFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb; 2 | 3 | import android.content.ContentResolver; 4 | 5 | import com.ulicae.cinelog.room.dto.ItemDto; 6 | import com.ulicae.cinelog.io.exportdb.exporter.ExporterFactory; 7 | import com.ulicae.cinelog.utils.ToasterWrapper; 8 | 9 | public class SnapshotExporterFactory { 10 | 11 | private final ToasterWrapper toasterWrapper; 12 | private final ContentResolver contentResolver; 13 | 14 | public SnapshotExporterFactory(ToasterWrapper toasterWrapper, 15 | ContentResolver contentResolver) { 16 | this.toasterWrapper = toasterWrapper; 17 | this.contentResolver = contentResolver; 18 | } 19 | 20 | public SnapshotExporter makeSnapshotExporter(ExporterFactory exporterFactory) { 21 | return new SnapshotExporter<>(exporterFactory, contentResolver); 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dto/ItemDto.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dto; 2 | 3 | /** 4 | * CineLog Copyright 2020 Pierre Rognon 5 | * 6 | * 7 | * This file is part of CineLog. 8 | * CineLog is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * CineLog is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with CineLog. If not, see . 20 | * 21 | */ 22 | public interface ItemDto { 23 | 24 | Long getId(); 25 | 26 | void setId(Long id); 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/fragments/AddableFragment.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.fragments; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | import androidx.fragment.app.Fragment; 9 | 10 | import com.google.android.material.floatingactionbutton.FloatingActionButton; 11 | import com.ulicae.cinelog.android.v2.activities.MainActivity; 12 | 13 | public abstract class AddableFragment extends Fragment { 14 | 15 | @Override 16 | public void onViewCreated(@NonNull View view, 17 | @Nullable Bundle savedInstanceState) { 18 | FloatingActionButton fab = ((MainActivity) requireActivity()).getFab(); 19 | fab.setOnClickListener(v -> onFabClick()); 20 | fab.setImageResource(getFabImage()); 21 | fab.show(); 22 | } 23 | 24 | protected abstract int getFabImage(); 25 | 26 | protected abstract void onFabClick(); 27 | 28 | } 29 | -------------------------------------------------------------------------------- /app/src/test/java/com/ulicae/cinelog/network/TmdbGetterServiceTest.java: -------------------------------------------------------------------------------- 1 | /* 2 | package com.ulicae.cinelog.network; 3 | 4 | import com.ulicae.cinelog.data.SerieService; 5 | 6 | import org.junit.runner.RunWith; 7 | import org.mockito.Mock; 8 | import org.mockito.junit.MockitoJUnitRunner; 9 | 10 | 11 | @RunWith(MockitoJUnitRunner.class) 12 | public class TmdbGetterServiceTest { 13 | 14 | @Mock 15 | private TmdbServiceWrapper tmdbServiceWrapper; 16 | 17 | @Mock 18 | private SerieService serieService; 19 | 20 | */ 21 | /* @Test 22 | public void getSerieDtoWithTmdbId() { 23 | //noinspection unchecked 24 | Call call = mock(Call.class); 25 | doReturn(call).when(tmdbServiceWrapper).searchTvShowById(24); 26 | 27 | SerieReview serieReview = mock(SerieReview.class); 28 | 29 | new TmdbGetterService(tmdbServiceWrapper).startSyncWithTmdb(serieService, serieReview,24L); 30 | // TODO test task is created and called 31 | }*//* 32 | 33 | 34 | }*/ 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/sqlite/DbHelper.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.sqlite; 2 | 3 | import android.content.Context; 4 | import android.database.sqlite.SQLiteDatabase; 5 | import android.database.sqlite.SQLiteOpenHelper; 6 | 7 | // TODO ici, récupérer les données de l'ancienne base pour les donner à Room 8 | public class DbHelper extends SQLiteOpenHelper { 9 | // If you change the database schema, you must increment the database version. 10 | public static final int DATABASE_VERSION = 1; 11 | public static final String DATABASE_NAME = "notes-db"; 12 | 13 | public DbHelper(Context context) { 14 | super(context, DATABASE_NAME, null, DATABASE_VERSION); 15 | } 16 | public void onCreate(SQLiteDatabase db) { 17 | } 18 | 19 | public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) { 20 | onCreate(db); 21 | } 22 | public void onDowngrade(SQLiteDatabase db, int oldVersion, int newVersion) { 23 | onUpgrade(db, oldVersion, newVersion); 24 | } 25 | } 26 | 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/LocaleWrapper.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils; 2 | 3 | import java.util.Locale; 4 | 5 | /** 6 | * CineLog Copyright 2018 Pierre Rognon 7 | * 8 | * This file is part of CineLog. 9 | * CineLog is free software: you can redistribute it and/or modify 10 | * it under the terms of the GNU General Public License as published by 11 | * the Free Software Foundation, either version 3 of the License, or 12 | * (at your option) any later version. 13 | * 14 | * CineLog is distributed in the hope that it will be useful, 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 | * GNU General Public License for more details. 18 | * 19 | * You should have received a copy of the GNU General Public License 20 | * along with CineLog. If not, see . 21 | * 22 | */ 23 | public class LocaleWrapper { 24 | 25 | public String getLanguage(){ 26 | return Locale.getDefault().getLanguage(); 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/network/DtoBuilderFromTmdbObject.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.network; 2 | 3 | import com.ulicae.cinelog.room.dto.KinoDto; 4 | 5 | /** 6 | * CineLog Copyright 2018 Pierre Rognon 7 | *

8 | *

9 | * This file is part of CineLog. 10 | * CineLog is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | *

15 | * CineLog is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | *

20 | * You should have received a copy of the GNU General Public License 21 | * along with CineLog. If not, see . 22 | */ 23 | public interface DtoBuilderFromTmdbObject { 24 | 25 | KinoDto build(T tmdbObject); 26 | 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/importdb/ImportException.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.importdb; 2 | 3 | /** 4 | * CineLog Copyright 2018 Pierre Rognon 5 | * 6 | * 7 | * This file is part of CineLog. 8 | * CineLog is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | * 13 | * CineLog is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | * 18 | * You should have received a copy of the GNU General Public License 19 | * along with CineLog. If not, see . 20 | * 21 | */ 22 | public class ImportException extends Exception { 23 | 24 | public ImportException(String message, Throwable cause) { 25 | super(message, cause); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 16dp 22 | 16dp 23 | 16dp 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/xml/preference_headers.xml: -------------------------------------------------------------------------------- 1 | 18 | 20 | 21 |

24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/exporter/CsvExporter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.exporter; 2 | 3 | import com.ulicae.cinelog.room.dto.ItemDto; 4 | 5 | import java.util.List; 6 | 7 | import io.reactivex.rxjava3.core.Flowable; 8 | 9 | /** 10 | * CineLog Copyright 2024 Pierre Rognon 11 | *

12 | *

13 | * This file is part of CineLog. 14 | * CineLog is free software: you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation, either version 3 of the License, or 17 | * (at your option) any later version. 18 | *

19 | * CineLog is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | *

24 | * You should have received a copy of the GNU General Public License 25 | * along with CineLog. If not, see . 26 | */ 27 | public interface CsvExporter { 28 | Flowable> export(); 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_review.xml: -------------------------------------------------------------------------------- 1 | 16 |

20 | 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 23 | 64dp 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/exporter/ExporterFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.exporter; 2 | 3 | import com.ulicae.cinelog.room.dto.ItemDto; 4 | 5 | import java.io.FileWriter; 6 | import java.io.IOException; 7 | 8 | /** 9 | * CineLog Copyright 2024 Pierre Rognon 10 | *

11 | *

12 | * This file is part of CineLog. 13 | * CineLog is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | *

18 | * CineLog is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | *

23 | * You should have received a copy of the GNU General Public License 24 | * along with CineLog. If not, see . 25 | */ 26 | public interface ExporterFactory { 27 | 28 | CsvExporter makeCsvExporter(FileWriter fileWriter) throws IOException; 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/res/values-v21/styles.xml: -------------------------------------------------------------------------------- 1 | 19 | 20 | 21 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/AutomaticExportException.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb; 2 | 3 | /** 4 | * CineLog Copyright 2018 Pierre Rognon 5 | *

6 | *

7 | * This file is part of CineLog. 8 | * CineLog is free software: you can redistribute it and/or modify 9 | * it under the terms of the GNU General Public License as published by 10 | * the Free Software Foundation, either version 3 of the License, or 11 | * (at your option) any later version. 12 | *

13 | * CineLog is distributed in the hope that it will be useful, 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | * GNU General Public License for more details. 17 | *

18 | * You should have received a copy of the GNU General Public License 19 | * along with CineLog. If not, see . 20 | */ 21 | public class AutomaticExportException extends Exception { 22 | 23 | private int stringCode; 24 | 25 | AutomaticExportException(Throwable cause, int stringCode) { 26 | super(cause); 27 | this.stringCode = stringCode; 28 | } 29 | 30 | public int getStringCode() { 31 | return stringCode; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/network/task/NetworkTaskCreator.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.network.task; 2 | 3 | import android.os.AsyncTask; 4 | 5 | import com.ulicae.cinelog.android.v2.fragments.review.room.tmdbsearch.SearchTmdbFragment; 6 | import com.uwetrottmann.tmdb2.entities.BaseRatingObject; 7 | 8 | /** 9 | * CineLog Copyright 2018 Pierre Rognon 10 | *

11 | *

12 | * This file is part of CineLog. 13 | * CineLog is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | *

18 | * CineLog is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | *

23 | * You should have received a copy of the GNU General Public License 24 | * along with CineLog. If not, see . 25 | */ 26 | public interface NetworkTaskCreator { 27 | 28 | T create(SearchTmdbFragment addKino); 29 | 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/network/task/TvNetworkTaskCreator.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.network.task; 2 | 3 | import com.ulicae.cinelog.android.v2.fragments.review.room.tmdbsearch.SearchTmdbFragment; 4 | import com.uwetrottmann.tmdb2.entities.TvShow; 5 | 6 | 7 | /** 8 | * CineLog Copyright 2018 Pierre Rognon 9 | *

10 | *

11 | * This file is part of CineLog. 12 | * CineLog is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | *

17 | * CineLog is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | *

22 | * You should have received a copy of the GNU General Public License 23 | * along with CineLog. If not, see . 24 | */ 25 | public class TvNetworkTaskCreator implements NetworkTaskCreator { 26 | 27 | public TvNetworkTask create(SearchTmdbFragment searchTmdbFragment) { 28 | return new TvNetworkTask(searchTmdbFragment); 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/network/task/MovieNetworkTaskCreator.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.network.task; 2 | 3 | import com.ulicae.cinelog.android.v2.fragments.review.room.tmdbsearch.SearchTmdbFragment; 4 | import com.uwetrottmann.tmdb2.entities.Movie; 5 | 6 | 7 | /** 8 | * CineLog Copyright 2022 Pierre Rognon 9 | *

10 | *

11 | * This file is part of CineLog. 12 | * CineLog is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | *

17 | * CineLog is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | *

22 | * You should have received a copy of the GNU General Public License 23 | * along with CineLog. If not, see . 24 | */ 25 | public class MovieNetworkTaskCreator implements NetworkTaskCreator { 26 | public MovieNetworkTask create(SearchTmdbFragment searchTmdbFragment) { 27 | return new MovieNetworkTask(searchTmdbFragment); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/SyncRoomDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Delete; 4 | import androidx.room.Insert; 5 | import androidx.room.OnConflictStrategy; 6 | 7 | import java.util.List; 8 | 9 | 10 | /** 11 | * CineLog Copyright 2024 Pierre Rognon 12 | *

13 | *

14 | * This file is part of CineLog. 15 | * CineLog is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | *

20 | * CineLog is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | *

25 | * You should have received a copy of the GNU General Public License 26 | * along with CineLog. If not, see . 27 | */ 28 | public interface SyncRoomDao extends RoomDao{ 29 | 30 | @Insert 31 | long[] insertAll(List entities); 32 | 33 | @Insert(onConflict = OnConflictStrategy.REPLACE) 34 | long insert(T entity); 35 | 36 | @Delete 37 | void delete(T entity); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dto/utils/to/TagToDtoBuilder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dto.utils.to; 2 | 3 | import com.ulicae.cinelog.room.dto.TagDto; 4 | import com.ulicae.cinelog.room.entities.Tag; 5 | 6 | /** 7 | * CineLog Copyright 2024 Pierre Rognon 8 | * 9 | * 10 | * This file is part of CineLog. 11 | * CineLog is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * CineLog is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with CineLog. If not, see . 23 | * 24 | */ 25 | public class TagToDtoBuilder { 26 | 27 | public TagDto build(Tag tag) { 28 | return new TagDto( 29 | tag.getId(), 30 | tag.getName(), 31 | tag.getColor(), 32 | tag.isForMovies(), 33 | tag.isForSeries() 34 | ); 35 | } 36 | } 37 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_tag_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 24 | 25 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dto/data/TvShowToSerieDataDtoBuilder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dto.data; 2 | 3 | import android.annotation.SuppressLint; 4 | import androidx.annotation.Nullable; 5 | 6 | import com.uwetrottmann.tmdb2.entities.BaseTvShow; 7 | 8 | import java.text.SimpleDateFormat; 9 | import java.util.Date; 10 | 11 | public class TvShowToSerieDataDtoBuilder { 12 | 13 | public WishlistDataDto build(BaseTvShow tvShow) { 14 | @SuppressLint("SimpleDateFormat") SimpleDateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy"); 15 | return new WishlistDataDto( 16 | null, 17 | (long) tvShow.id, 18 | tvShow.name, 19 | tvShow.poster_path, 20 | tvShow.overview, 21 | getYear(tvShow.first_air_date), 22 | tvShow.first_air_date != null ? dateFormat.format(tvShow.first_air_date) : null, 23 | WishlistItemType.SERIE 24 | ); 25 | } 26 | 27 | @Nullable 28 | private int getYear(Date firstAirDate) { 29 | if(firstAirDate != null) { 30 | @SuppressLint("SimpleDateFormat") String date = new SimpleDateFormat("yyyy").format(firstAirDate); 31 | return date != null ? Integer.parseInt(date) : 0; 32 | } 33 | return 0; 34 | } 35 | } 36 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_serie_list.xml: -------------------------------------------------------------------------------- 1 | 18 | 24 | 25 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/importdb/CSVFormatWrapper.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.importdb; 2 | 3 | import org.apache.commons.csv.CSVFormat; 4 | import org.apache.commons.csv.CSVRecord; 5 | 6 | import java.io.FileReader; 7 | import java.io.IOException; 8 | 9 | /** 10 | * CineLog Copyright 2018 Pierre Rognon 11 | * 12 | * 13 | * This file is part of CineLog. 14 | * CineLog is free software: you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation, either version 3 of the License, or 17 | * (at your option) any later version. 18 | * 19 | * CineLog is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | * 24 | * You should have received a copy of the GNU General Public License 25 | * along with CineLog. If not, see . 26 | * 27 | */ 28 | class CSVFormatWrapper { 29 | 30 | Iterable parse(FileReader fileReader) throws IOException { 31 | return CSVFormat.DEFAULT 32 | .withDelimiter('§') 33 | .withQuote('`') 34 | .withFirstRecordAsHeader() 35 | .parse(fileReader); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_movie_list.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 25 | 26 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_room_list.xml: -------------------------------------------------------------------------------- 1 | 18 | 24 | 25 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/SyncTmdbSerieEpisodeDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Query; 5 | 6 | import com.ulicae.cinelog.room.entities.TmdbSerieEpisode; 7 | 8 | import java.util.List; 9 | 10 | 11 | /** 12 | * CineLog Copyright 2024 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | @Dao 30 | public interface SyncTmdbSerieEpisodeDao extends SyncRoomDao { 31 | 32 | @Query("SELECT * FROM tmdbserieepisode") 33 | List findAll(); 34 | 35 | @Query("SELECT * FROM tmdbserieepisode WHERE tmdb_episode_id = :id") 36 | TmdbSerieEpisode find(long id); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_import_db.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_export_db.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 25 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/review/room/list/ReviewListYearViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.room.list; 2 | 3 | import android.widget.TextView; 4 | 5 | import com.ulicae.cinelog.databinding.ReviewListYearRowBinding; 6 | 7 | /** 8 | * CineLog Copyright 2022 Pierre Rognon 9 | *

10 | *

11 | * This file is part of CineLog. 12 | * CineLog is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | *

17 | * CineLog is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | *

22 | * You should have received a copy of the GNU General Public License 23 | * along with CineLog. If not, see . 24 | */ 25 | public class ReviewListYearViewHolder { 26 | 27 | private final ReviewListYearRowBinding binding; 28 | 29 | ReviewListYearViewHolder(ReviewListYearRowBinding binding) { 30 | this.binding = binding; 31 | } 32 | 33 | public TextView getKinoTitle() { 34 | return binding.mainResultKinoTitle; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/ThemeWrapper.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils; 2 | 3 | import android.content.Context; 4 | 5 | import androidx.appcompat.app.AppCompatDelegate; 6 | 7 | /** 8 | * CineLog Copyright 2018 Pierre Rognon 9 | *

10 | *

11 | * This file is part of CineLog. 12 | * CineLog is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | *

17 | * CineLog is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | *

22 | * You should have received a copy of the GNU General Public License 23 | * along with CineLog. If not, see . 24 | */ 25 | public class ThemeWrapper { 26 | 27 | public void setThemeWithPreferences(Context context) { 28 | if (new PreferencesWrapper().getBooleanPreference(context.getApplicationContext(), "theme", false)) { 29 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES); 30 | } else { 31 | AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_FOLLOW_SYSTEM); 32 | } 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/entities/ReviewTagCrossRef.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.entities; 2 | 3 | import androidx.room.ColumnInfo; 4 | import androidx.room.Entity; 5 | import androidx.room.ForeignKey; 6 | 7 | import java.util.Objects; 8 | 9 | @Entity( 10 | primaryKeys = {"review_id", "tag_id"}, 11 | foreignKeys = { 12 | @ForeignKey( 13 | entity = Review.class, 14 | parentColumns = "id", 15 | childColumns = "review_id" 16 | ), 17 | @ForeignKey( 18 | entity = Tag.class, 19 | parentColumns = "id", 20 | childColumns = "tag_id" 21 | ) 22 | }) 23 | public class ReviewTagCrossRef { 24 | 25 | @ColumnInfo(name = "review_id") 26 | public long reviewId; 27 | 28 | @ColumnInfo(name = "tag_id") 29 | public long tagId; 30 | 31 | public ReviewTagCrossRef(long reviewId, long tagId) { 32 | this.reviewId = reviewId; 33 | this.tagId = tagId; 34 | } 35 | 36 | @Override 37 | public boolean equals(Object o) { 38 | if (this == o) return true; 39 | if (o == null || getClass() != o.getClass()) return false; 40 | ReviewTagCrossRef that = (ReviewTagCrossRef) o; 41 | return reviewId == that.reviewId && tagId == that.tagId; 42 | } 43 | 44 | @Override 45 | public int hashCode() { 46 | return Objects.hash(reviewId, tagId); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /fastlane/metadata/android/pl-PL/full_description.txt: -------------------------------------------------------------------------------- 1 | Recenzuj i oceniaj obejrzane filmy i seriale. Stwórz swój własny katalog recenzji! 2 | 3 | Cechy: 4 | 5 |

    6 |
  • Szukaj filmów i seriali za pomocą serwisu TMDb.
  • 7 |
  • Wybierz język danych pobieranych z serwisu TMDb.
  • 8 |
  • Dodawaj recenzje do filmów i seriali.
  • 9 |
  • Nie możesz znaleźć szukanego filmu? Utwórz recenzję bez użycia TMDb.
  • 10 |
  • Ustaw najwyższą ocenę, jaką może otrzymać recenzowany film lub serial.
  • 11 |
  • Dodawaj filmy i seriale do obejrzenia.
  • 12 |
  • Wyeksportuj swój katalog recenzji do pliku CSV.
  • 13 |
  • Zaimportuj istniejący katalog recenzji.
  • 14 |
  • Włącz automatyczne tworzenie kopii zapasowej (można użyć do synchronizacji recenzji).
  • 15 |
16 | 17 | Uprawnienia: 18 | 19 |
    20 |
  • INTERNET – wyszukiwanie filmów i seriali w serwisie TMDb.
  • 21 |
  • ACCESS_NETWORK_STATE – sprawdzanie dostępności Internetu.
  • 22 |
  • READ_EXTERNAL_STORAGE – wczytywanie importowanych plików.
  • 23 |
  • WRITE_EXTERNAL_STORAGE – eksportowanie bazy danych do pliku CSV.
  • 24 |
25 | 26 | Specjalne podziękowania: 27 | 28 | Dla Christopher Bodtke, który dodał niemieckie tłumaczenie. 29 | Dla Diego Sangunietti, który dodał hiszpańskie tłumaczenie. 30 | 31 | Dla Kerstin Maur, która życzliwie zaprojektowała ikonę i zaproponowała schemat kolorów dla CineLog. 32 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/SyncWishlistItemDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Query; 5 | 6 | import com.ulicae.cinelog.room.entities.ItemEntityType; 7 | import com.ulicae.cinelog.room.entities.WishlistItem; 8 | 9 | import java.util.List; 10 | 11 | 12 | /** 13 | * CineLog Copyright 2024 Pierre Rognon 14 | *

15 | *

16 | * This file is part of CineLog. 17 | * CineLog is free software: you can redistribute it and/or modify 18 | * it under the terms of the GNU General Public License as published by 19 | * the Free Software Foundation, either version 3 of the License, or 20 | * (at your option) any later version. 21 | *

22 | * CineLog is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | *

27 | * You should have received a copy of the GNU General Public License 28 | * along with CineLog. If not, see . 29 | */ 30 | @Dao 31 | public interface SyncWishlistItemDao extends SyncRoomDao { 32 | 33 | @Query("SELECT * FROM wishlistitem WHERE item_entity_type = :itemEntityType") 34 | List findAll(ItemEntityType itemEntityType); 35 | 36 | @Query("SELECT * FROM wishlistitem WHERE id = :id") 37 | WishlistItem find(long id); 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/AsyncRoomDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Delete; 4 | import androidx.room.Insert; 5 | import androidx.room.OnConflictStrategy; 6 | 7 | import java.util.List; 8 | 9 | import io.reactivex.rxjava3.core.Completable; 10 | import io.reactivex.rxjava3.core.Single; 11 | 12 | 13 | /** 14 | * CineLog Copyright 2024 Pierre Rognon 15 | *

16 | *

17 | * This file is part of CineLog. 18 | * CineLog is free software: you can redistribute it and/or modify 19 | * it under the terms of the GNU General Public License as published by 20 | * the Free Software Foundation, either version 3 of the License, or 21 | * (at your option) any later version. 22 | *

23 | * CineLog is distributed in the hope that it will be useful, 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | * GNU General Public License for more details. 27 | *

28 | * You should have received a copy of the GNU General Public License 29 | * along with CineLog. If not, see . 30 | */ 31 | public interface AsyncRoomDao extends RoomDao { 32 | 33 | @Insert(onConflict = OnConflictStrategy.REPLACE) 34 | Single> insertAll(List entities); 35 | 36 | @Insert(onConflict = OnConflictStrategy.REPLACE) 37 | Single insert(T entity); 38 | 39 | @Delete 40 | Completable delete(T entity); 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/fragments/wishlist/list/WishlistMovieRoomListFragment.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.fragments.wishlist.list; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | 9 | import com.ulicae.cinelog.room.entities.ItemEntityType; 10 | 11 | /** 12 | * CineLog Copyright 2024 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | public class WishlistMovieRoomListFragment extends WishlistRoomListFragment { 30 | 31 | @Override 32 | public void onViewCreated(@NonNull View view, 33 | @Nullable Bundle savedInstanceState) { 34 | itemEntityType = ItemEntityType.MOVIE; 35 | super.onViewCreated(view, savedInstanceState); 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/fragments/wishlist/list/WishlistSerieRoomListFragment.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.fragments.wishlist.list; 2 | 3 | import android.os.Bundle; 4 | import android.view.View; 5 | 6 | import androidx.annotation.NonNull; 7 | import androidx.annotation.Nullable; 8 | 9 | import com.ulicae.cinelog.room.entities.ItemEntityType; 10 | 11 | /** 12 | * CineLog Copyright 2024 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | public class WishlistSerieRoomListFragment extends WishlistRoomListFragment { 30 | 31 | @Override 32 | public void onViewCreated(@NonNull View view, 33 | @Nullable Bundle savedInstanceState) { 34 | itemEntityType = ItemEntityType.SERIE; 35 | super.onViewCreated(view, savedInstanceState); 36 | } 37 | 38 | } 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/BusinessPreferenceGetter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils; 2 | 3 | import android.content.Context; 4 | 5 | /** 6 | * CineLog Copyright 2018 Pierre Rognon 7 | *

8 | *

9 | * This file is part of CineLog. 10 | * CineLog is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | *

15 | * CineLog is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | *

20 | * You should have received a copy of the GNU General Public License 21 | * along with CineLog. If not, see . 22 | */ 23 | public class BusinessPreferenceGetter { 24 | 25 | private Context context; 26 | private PreferencesWrapper preferencesWrapper; 27 | 28 | public BusinessPreferenceGetter(Context context){ 29 | this(context, new PreferencesWrapper()); 30 | } 31 | 32 | BusinessPreferenceGetter(Context context, PreferencesWrapper preferencesWrapper) { 33 | this.context = context; 34 | this.preferencesWrapper = preferencesWrapper; 35 | } 36 | 37 | public boolean getAutomaticExport() { 38 | return preferencesWrapper.getBooleanPreference(context, "automatic_save", false); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/writer/CsvExportWriter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.writer; 2 | 3 | import java.io.IOException; 4 | 5 | /** 6 | * CineLog Copyright 2018 Pierre Rognon 7 | *

8 | *

9 | * This file is part of CineLog. 10 | * CineLog is free software: you can redistribute it and/or modify 11 | * it under the terms of the GNU General Public License as published by 12 | * the Free Software Foundation, either version 3 of the License, or 13 | * (at your option) any later version. 14 | *

15 | * CineLog is distributed in the hope that it will be useful, 16 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | * GNU General Public License for more details. 19 | *

20 | * You should have received a copy of the GNU General Public License 21 | * along with CineLog. If not, see . 22 | */ 23 | public abstract class CsvExportWriter { 24 | 25 | CSVPrinterWrapper csvPrinterWrapper; 26 | 27 | CsvExportWriter(Appendable out, Class> headers) throws IOException { 28 | this(new CSVPrinterWrapper(out, headers)); 29 | } 30 | 31 | CsvExportWriter(CSVPrinterWrapper csvPrinterWrapper) { 32 | this.csvPrinterWrapper = csvPrinterWrapper; 33 | } 34 | 35 | public abstract void write(T dto) throws IOException; 36 | 37 | public void endWriting() throws IOException { 38 | csvPrinterWrapper.flush(); 39 | csvPrinterWrapper.close(); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/TagDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Query; 5 | 6 | import com.ulicae.cinelog.room.entities.Tag; 7 | 8 | import java.util.List; 9 | 10 | import io.reactivex.rxjava3.core.Flowable; 11 | 12 | 13 | /** 14 | * CineLog Copyright 2024 Pierre Rognon 15 | *

16 | *

17 | * This file is part of CineLog. 18 | * CineLog is free software: you can redistribute it and/or modify 19 | * it under the terms of the GNU General Public License as published by 20 | * the Free Software Foundation, either version 3 of the License, or 21 | * (at your option) any later version. 22 | *

23 | * CineLog is distributed in the hope that it will be useful, 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | * GNU General Public License for more details. 27 | *

28 | * You should have received a copy of the GNU General Public License 29 | * along with CineLog. If not, see . 30 | */ 31 | @Dao 32 | public interface TagDao extends AsyncRoomDao { 33 | 34 | @Query("SELECT * FROM tag") 35 | Flowable> findAll(); 36 | 37 | @Query("SELECT * FROM tag WHERE for_movies = true") 38 | Flowable> findMovieTags(); 39 | 40 | @Query("SELECT * FROM tag WHERE for_series = true") 41 | Flowable> findSerieTags(); 42 | 43 | @Query("SELECT * FROM tag WHERE id = :id") 44 | Flowable find(long id); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/image/ImageCacheDownloader.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils.image; 2 | 3 | import java.io.File; 4 | 5 | public class ImageCacheDownloader { 6 | 7 | static final String BASE_URL = "https://image.tmdb.org/t/p/w185/"; 8 | 9 | private final File cacheDir; 10 | private final String filePath; 11 | private final ImageFinderFactory imageFinderFactory; 12 | private final CacheImageDownloaderTaskFactory taskFactory; 13 | 14 | public ImageCacheDownloader(File cacheDir, String filePath) { 15 | this(cacheDir, filePath, new ImageFinderFactory(), new CacheImageDownloaderTaskFactory()); 16 | } 17 | 18 | ImageCacheDownloader(File cacheDir, String filePath, ImageFinderFactory imageFinderFactory, 19 | CacheImageDownloaderTaskFactory cacheImageDownloaderTaskFactory) { 20 | this.cacheDir = cacheDir; 21 | this.filePath = filePath; 22 | this.imageFinderFactory = imageFinderFactory; 23 | this.taskFactory = cacheImageDownloaderTaskFactory; 24 | } 25 | 26 | public ImageFinder getPosterFinder() { 27 | if (!isPosterInCache()) { 28 | taskFactory.makeTask(cacheDir, filePath).execute(); 29 | return imageFinderFactory.makeNetworkImageFinder(); 30 | } 31 | return imageFinderFactory.makeCacheImageFinder(cacheDir); 32 | } 33 | 34 | boolean isPosterInCache() { 35 | return ((ImageCacheFinder) imageFinderFactory.makeCacheImageFinder(cacheDir)) 36 | .getImage(filePath).exists(); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/SnapshotExporter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb; 2 | 3 | import android.content.ContentResolver; 4 | import android.net.Uri; 5 | import android.os.ParcelFileDescriptor; 6 | 7 | import com.ulicae.cinelog.room.dto.ItemDto; 8 | import com.ulicae.cinelog.io.exportdb.exporter.CsvExporter; 9 | import com.ulicae.cinelog.io.exportdb.exporter.ExporterFactory; 10 | 11 | import java.io.FileDescriptor; 12 | import java.io.FileWriter; 13 | import java.io.IOException; 14 | import java.util.List; 15 | 16 | import io.reactivex.rxjava3.core.Flowable; 17 | 18 | public class SnapshotExporter { 19 | private final ExporterFactory exporterFactory; 20 | private final ContentResolver contentResolver; 21 | 22 | SnapshotExporter(ExporterFactory exporterFactory, 23 | ContentResolver contentResolver) { 24 | this.exporterFactory = exporterFactory; 25 | this.contentResolver = contentResolver; 26 | } 27 | 28 | public Flowable> export(Uri exportFilename) throws IOException { 29 | ParcelFileDescriptor parcelFileDescriptor = contentResolver.openFileDescriptor(exportFilename, "w"); 30 | if (parcelFileDescriptor == null) { 31 | throw new IOException(); 32 | } 33 | 34 | FileDescriptor fd = parcelFileDescriptor.getFileDescriptor(); 35 | FileWriter fileWriter = new FileWriter(fd); 36 | 37 | CsvExporter csvExporter = exporterFactory.makeCsvExporter(fileWriter); 38 | return csvExporter.export(); 39 | } 40 | 41 | 42 | } 43 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_simple.xml: -------------------------------------------------------------------------------- 1 | 18 |

22 | 27 | 32 | 37 | -------------------------------------------------------------------------------- /app/src/test/java/com/ulicae/cinelog/room/dto/utils/from/TagFromDtoCreatorTest.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dto.utils.from; 2 | 3 | import com.ulicae.cinelog.room.dto.TagDto; 4 | import com.ulicae.cinelog.room.dao.TagDao; 5 | import com.ulicae.cinelog.room.entities.Tag; 6 | 7 | import junit.framework.TestCase; 8 | 9 | import org.mockito.Mock; 10 | 11 | public class TagFromDtoCreatorTest extends TestCase { 12 | 13 | @Mock 14 | private TagDao tagDao; 15 | 16 | public void testCreateRoomInstanceFromDto() { 17 | assertEquals( 18 | new Tag(453, "a tag", "#000000", false, true), 19 | new TagFromDtoCreator(tagDao).createRoomInstanceFromDto( 20 | new TagDto( 21 | 453L, 22 | "a tag", 23 | "#000000", 24 | false, 25 | true 26 | ) 27 | ) 28 | ); 29 | } 30 | 31 | public void testCreateRoomInstanceFromDtoNullId() { 32 | assertEquals( 33 | new Tag(0, "a tag", "#000000", false, true), 34 | new TagFromDtoCreator(tagDao).createRoomInstanceFromDto( 35 | new TagDto( 36 | null, 37 | "a tag", 38 | "#000000", 39 | false, 40 | true 41 | ) 42 | ) 43 | ); 44 | } 45 | } -------------------------------------------------------------------------------- /fastlane/metadata/android/en-US/full_description.txt: -------------------------------------------------------------------------------- 1 | Rate and review movies you saw. Build your own review database ! 2 | 3 | Features: 4 | 5 |
    6 |
  • Search for movies and series with [https://www.themoviedb.org/ tmdb.org] API;
  • 7 |
  • Choose tmdb language you want to use;
  • 8 |
  • Add a review for movies and series you found in a local database;
  • 9 |
  • Can't find the movies you're looking for ? Create a review without tmdb search;
  • 10 |
  • Choose the maximum rating you want to use;
  • 11 |
  • Save your movie and serie wishlist;
  • 12 |
  • Save your current series progress;
  • 13 |
  • Use tags to group series and movies;
  • 14 |
  • Export your review database in CSV format;
  • 15 |
  • Import an existing review database;
  • 16 |
  • Enable an automatic CSV backup (can then be synchronised with a cloud client).
  • 17 |
18 | 19 | Permissions: 20 | 21 |
    22 |
  • INTERNET to look for movies in tmdb
  • 23 |
  • ACCESS_NETWORK_STATE to know if you're connected to Internet or not
  • 24 |
  • READ_EXTERNAL_STORAGE to read files to import
  • 25 |
  • WRITE_EXTERNAL_STORAGE to export database as a CSV file
  • 26 |
27 | 28 | Special thanks: 29 | 30 | To Christopher Bodtke that wrote German translation. 31 | To Diego Sangunietti that wrote Spanish translation. 32 | To verahawk that wrote Polish translation. 33 | To Vistaus that wrote Dutch translation. 34 | To sr093906 that wrote Chinese translation 35 | 36 | To Kerstin Maur that kindly designed an icon for CineLog and suggested colors. 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/services/AsyncServiceFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.services; 2 | 3 | import com.ulicae.cinelog.KinoApplication; 4 | import com.ulicae.cinelog.room.dto.KinoDto; 5 | import com.ulicae.cinelog.room.entities.ItemEntityType; 6 | 7 | /** 8 | * CineLog Copyright 2024 Pierre Rognon 9 | *

10 | *

11 | * This file is part of CineLog. 12 | * CineLog is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | *

17 | * CineLog is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | *

22 | * You should have received a copy of the GNU General Public License 23 | * along with CineLog. If not, see . 24 | */ 25 | public class AsyncServiceFactory { 26 | 27 | // TODO is this class needed 28 | public AsyncDataService create(String type, KinoApplication app) { 29 | switch (type) { 30 | case "kino": 31 | return new ReviewAsyncService(app, ItemEntityType.MOVIE); 32 | case "serie": 33 | return new ReviewAsyncService(app, ItemEntityType.SERIE); 34 | } 35 | 36 | throw new NullPointerException("Unable to find a service for this type."); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dto/utils/from/TagFromDtoCreator.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dto.utils.from; 2 | 3 | import com.ulicae.cinelog.room.dto.TagDto; 4 | import com.ulicae.cinelog.room.dao.TagDao; 5 | import com.ulicae.cinelog.room.entities.Tag; 6 | 7 | /** 8 | * CineLog Copyright 2024 Pierre Rognon 9 | *

10 | *

11 | * This file is part of CineLog. 12 | * CineLog is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | *

17 | * CineLog is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | *

22 | * You should have received a copy of the GNU General Public License 23 | * along with CineLog. If not, see . 24 | */ 25 | public class TagFromDtoCreator extends AsyncEntityFromDtoCreator{ 26 | public TagFromDtoCreator(TagDao tagDao) { 27 | super(tagDao); 28 | } 29 | 30 | @Override 31 | Tag createRoomInstanceFromDto(TagDto itemDto) { 32 | return new Tag( 33 | itemDto.getId() != null ? Math.toIntExact(itemDto.getId()) : 0, 34 | itemDto.getName(), 35 | itemDto.getColor(), 36 | itemDto.isForMovies(), 37 | itemDto.isForSeries() 38 | ); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/res/values-night/styles.xml: -------------------------------------------------------------------------------- 1 | 18 | 19 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toolbar.xml: -------------------------------------------------------------------------------- 1 | 18 | 23 | 24 | 33 | 34 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/TmdbSerieEpisodeDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Query; 5 | 6 | import com.ulicae.cinelog.room.entities.TmdbSerieEpisode; 7 | 8 | import java.util.List; 9 | 10 | import io.reactivex.rxjava3.core.Completable; 11 | import io.reactivex.rxjava3.core.Flowable; 12 | 13 | 14 | /** 15 | * CineLog Copyright 2024 Pierre Rognon 16 | *

17 | *

18 | * This file is part of CineLog. 19 | * CineLog is free software: you can redistribute it and/or modify 20 | * it under the terms of the GNU General Public License as published by 21 | * the Free Software Foundation, either version 3 of the License, or 22 | * (at your option) any later version. 23 | *

24 | * CineLog is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * GNU General Public License for more details. 28 | *

29 | * You should have received a copy of the GNU General Public License 30 | * along with CineLog. If not, see . 31 | */ 32 | @Dao 33 | public interface TmdbSerieEpisodeDao extends AsyncRoomDao { 34 | 35 | @Query("SELECT * FROM tmdbserieepisode") 36 | Flowable> findAll(); 37 | 38 | @Query("SELECT * FROM tmdbserieepisode WHERE tmdb_episode_id = :tmdbEpisodeId") 39 | Flowable find(long tmdbEpisodeId); 40 | 41 | @Query("DELETE FROM tmdbserieepisode WHERE review_id = :reviewId") 42 | Completable deleteByReviewId(long reviewId); 43 | } 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/review/edit/WishlistItemDeleter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.edit; 2 | 3 | import com.ulicae.cinelog.room.services.WishlistAsyncService; 4 | import com.ulicae.cinelog.room.AppDatabase; 5 | 6 | /** 7 | * CineLog Copyright 2024 Pierre Rognon 8 | *

9 | *

10 | * This file is part of CineLog. 11 | * CineLog is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | *

16 | * CineLog is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | *

21 | * You should have received a copy of the GNU General Public License 22 | * along with CineLog. If not, see . 23 | */ 24 | class WishlistItemDeleter { 25 | 26 | private WishlistAsyncService wishlistAsyncService; 27 | 28 | public WishlistItemDeleter(AppDatabase db) { 29 | this.wishlistAsyncService = new WishlistAsyncService(db); 30 | } 31 | 32 | WishlistItemDeleter(WishlistAsyncService wishlistAsyncService) { 33 | this.wishlistAsyncService = wishlistAsyncService; 34 | } 35 | 36 | public void deleteWishlistItem(Long id) { 37 | wishlistAsyncService 38 | .findById(id) 39 | .subscribe((item) -> wishlistAsyncService.delete(item).subscribe()); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_serie_view_episodes.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 23 | 24 | 32 | 33 | 39 | 40 | -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_serie_view_general.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 25 | 26 | 32 | 33 | 34 | 35 | 36 | 37 | -------------------------------------------------------------------------------- /app/src/test/java/com/ulicae/cinelog/io/exportdb/writer/WishlistCsvExportWriterTest.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.writer; 2 | 3 | import com.ulicae.cinelog.room.dto.data.WishlistDataDto; 4 | import com.ulicae.cinelog.room.dto.data.WishlistItemType; 5 | 6 | import org.junit.Test; 7 | import org.junit.runner.RunWith; 8 | import org.mockito.Mock; 9 | import org.mockito.junit.MockitoJUnitRunner; 10 | 11 | import static org.mockito.Mockito.verify; 12 | 13 | @RunWith(MockitoJUnitRunner.class) 14 | public class WishlistCsvExportWriterTest { 15 | 16 | @Mock 17 | private CSVPrinterWrapper csvPrinterWrapper; 18 | 19 | @Mock 20 | private WishlistDataDto wishlistDto; 21 | 22 | @Test 23 | public void write() throws Exception { 24 | wishlistDto = new WishlistDataDto( 25 | 24L, 26 | 25L, 27 | "a title", 28 | "/path", 29 | "an overview", 30 | 2012, 31 | "20120212", 32 | WishlistItemType.MOVIE 33 | ); 34 | 35 | new WishlistCsvExportWriter(csvPrinterWrapper).write(wishlistDto); 36 | 37 | verify(csvPrinterWrapper).printRecord( 38 | 24L, 39 | 25L, 40 | "a title", 41 | "an overview", 42 | 2012, 43 | "/path", 44 | "20120212", 45 | "MOVIE" 46 | ); 47 | } 48 | 49 | @Test 50 | public void endWriting() throws Exception { 51 | new WishlistCsvExportWriter(csvPrinterWrapper).endWriting(); 52 | 53 | verify(csvPrinterWrapper).flush(); 54 | verify(csvPrinterWrapper).close(); 55 | } 56 | 57 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/converters/Converters.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.converters; 2 | 3 | import androidx.room.TypeConverter; 4 | 5 | import com.ulicae.cinelog.room.entities.ItemEntityType; 6 | 7 | import java.util.Date; 8 | 9 | /** 10 | * CineLog Copyright 2024 Pierre Rognon 11 | *

12 | *

13 | * This file is part of CineLog. 14 | * CineLog is free software: you can redistribute it and/or modify 15 | * it under the terms of the GNU General Public License as published by 16 | * the Free Software Foundation, either version 3 of the License, or 17 | * (at your option) any later version. 18 | *

19 | * CineLog is distributed in the hope that it will be useful, 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 22 | * GNU General Public License for more details. 23 | *

24 | * You should have received a copy of the GNU General Public License 25 | * along with CineLog. If not, see . 26 | */ 27 | public class Converters { 28 | @TypeConverter 29 | public static Date fromTimestamp(Long value) { 30 | return value == null ? null : new Date(value); 31 | } 32 | 33 | @TypeConverter 34 | public static Long dateToTimestamp(Date date) { 35 | return date == null ? null : date.getTime(); 36 | } 37 | 38 | @TypeConverter 39 | public static String reviewEntityTypeToString(ItemEntityType itemEntityType) { 40 | return itemEntityType.toString(); 41 | } 42 | 43 | @TypeConverter 44 | public static ItemEntityType reviewEntityTypeFromString(String reviewEntityType) { 45 | return ItemEntityType.valueOf(reviewEntityType); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/fragments/wishlist/add/WishlistItemRoomViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.fragments.wishlist.add; 2 | 3 | import android.widget.ImageView; 4 | import android.widget.TextView; 5 | 6 | import androidx.cardview.widget.CardView; 7 | 8 | import com.ulicae.cinelog.databinding.WishlistSearchResultItemBinding; 9 | 10 | /** 11 | * CineLog Copyright 2022 Pierre Rognon 12 | *

13 | *

14 | * This file is part of CineLog. 15 | * CineLog is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | *

20 | * CineLog is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | *

25 | * You should have received a copy of the GNU General Public License 26 | * along with CineLog. If not, see . 27 | */ 28 | public class WishlistItemRoomViewHolder { 29 | 30 | private final WishlistSearchResultItemBinding binding; 31 | 32 | WishlistItemRoomViewHolder(WishlistSearchResultItemBinding binding) { 33 | this.binding = binding; 34 | } 35 | 36 | public TextView getTitle() { 37 | return binding.kinoTitle; 38 | } 39 | 40 | public TextView getYear() { 41 | return binding.kinoYear; 42 | } 43 | 44 | public ImageView getPoster() { 45 | return binding.kinoPoster; 46 | } 47 | 48 | public CardView getCardView() { return binding.kinoCardView; } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/ToasterWrapper.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils; 2 | 3 | import android.content.Context; 4 | import android.widget.Toast; 5 | 6 | /** 7 | * CineLog Copyright 2024 Pierre Rognon 8 | *

9 | *

10 | * This file is part of CineLog. 11 | * CineLog is free software: you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation, either version 3 of the License, or 14 | * (at your option) any later version. 15 | *

16 | * CineLog is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | *

21 | * You should have received a copy of the GNU General Public License 22 | * along with CineLog. If not, see . 23 | */ 24 | public class ToasterWrapper { 25 | 26 | public enum ToasterDuration { 27 | SHORT, 28 | LONG 29 | } 30 | 31 | private final Context context; 32 | 33 | public ToasterWrapper(Context context){ 34 | this.context = context; 35 | } 36 | 37 | public void toast(int value, ToasterDuration duration) { 38 | Toast.makeText(context, value, getToastDuration(duration)).show(); 39 | } 40 | 41 | public int getToastDuration(ToasterDuration toasterDuration) { 42 | switch (toasterDuration) { 43 | case LONG: 44 | return Toast.LENGTH_LONG; 45 | case SHORT: 46 | return Toast.LENGTH_SHORT; 47 | default: 48 | return Toast.LENGTH_SHORT; 49 | } 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/exporter/WishlistCsvExporterFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.exporter; 2 | 3 | import com.ulicae.cinelog.room.dto.data.WishlistDataDto; 4 | import com.ulicae.cinelog.io.exportdb.writer.WishlistCsvExportWriter; 5 | import com.ulicae.cinelog.room.services.WishlistAsyncService; 6 | 7 | import java.io.FileWriter; 8 | import java.io.IOException; 9 | 10 | /** 11 | * CineLog Copyright 2024 Pierre Rognon 12 | *

13 | *

14 | * This file is part of CineLog. 15 | * CineLog is free software: you can redistribute it and/or modify 16 | * it under the terms of the GNU General Public License as published by 17 | * the Free Software Foundation, either version 3 of the License, or 18 | * (at your option) any later version. 19 | *

20 | * CineLog is distributed in the hope that it will be useful, 21 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 22 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 23 | * GNU General Public License for more details. 24 | *

25 | * You should have received a copy of the GNU General Public License 26 | * along with CineLog. If not, see . 27 | */ 28 | public class WishlistCsvExporterFactory implements ExporterFactory { 29 | 30 | private final WishlistAsyncService wishlistService; 31 | 32 | public WishlistCsvExporterFactory(WishlistAsyncService wishlistService) { 33 | this.wishlistService = wishlistService; 34 | } 35 | 36 | // TODO give a toaster service 37 | public AsyncCsvExporter makeCsvExporter(FileWriter fileWriter) throws IOException { 38 | return new AsyncCsvExporter<>(wishlistService, new WishlistCsvExportWriter(fileWriter)); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/writer/TagCsvExportWriter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.writer; 2 | 3 | import com.ulicae.cinelog.room.dto.TagDto; 4 | 5 | import java.io.IOException; 6 | 7 | /** 8 | * CineLog Copyright 2018 Pierre Rognon 9 | * 10 | * 11 | * This file is part of CineLog. 12 | * CineLog is free software: you can redistribute it and/or modify 13 | * it under the terms of the GNU General Public License as published by 14 | * the Free Software Foundation, either version 3 of the License, or 15 | * (at your option) any later version. 16 | * 17 | * CineLog is distributed in the hope that it will be useful, 18 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 | * GNU General Public License for more details. 21 | * 22 | * You should have received a copy of the GNU General Public License 23 | * along with CineLog. If not, see . 24 | * 25 | */ 26 | public class TagCsvExportWriter extends CsvExportWriter { 27 | 28 | public enum Headers { 29 | id, 30 | name, 31 | color, 32 | forMovies, 33 | forSeries 34 | } 35 | 36 | public TagCsvExportWriter(Appendable out) throws IOException { 37 | super(out, Headers.class); 38 | } 39 | 40 | TagCsvExportWriter(CSVPrinterWrapper csvPrinterWrapper) { 41 | super(csvPrinterWrapper); 42 | } 43 | 44 | public void write(TagDto tagDto) throws IOException { 45 | csvPrinterWrapper.printRecord( 46 | tagDto.getId(), 47 | tagDto.getName(), 48 | tagDto.getColor(), 49 | tagDto.isForMovies(), 50 | tagDto.isForSeries() 51 | ); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/ReviewTagCrossRefDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Query; 5 | 6 | import com.ulicae.cinelog.room.entities.ReviewTagCrossRef; 7 | 8 | import java.util.List; 9 | 10 | import io.reactivex.rxjava3.core.Completable; 11 | import io.reactivex.rxjava3.core.Flowable; 12 | 13 | ; 14 | 15 | /** 16 | * CineLog Copyright 2024 Pierre Rognon 17 | *

18 | *

19 | * This file is part of CineLog. 20 | * CineLog is free software: you can redistribute it and/or modify 21 | * it under the terms of the GNU General Public License as published by 22 | * the Free Software Foundation, either version 3 of the License, or 23 | * (at your option) any later version. 24 | *

25 | * CineLog is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * GNU General Public License for more details. 29 | *

30 | * You should have received a copy of the GNU General Public License 31 | * along with CineLog. If not, see . 32 | */ 33 | @Dao 34 | public interface ReviewTagCrossRefDao extends AsyncRoomDao { 35 | 36 | @Query("SELECT * FROM reviewtagcrossref") 37 | Flowable> findAll(); 38 | 39 | @Query("SELECT * FROM reviewtagcrossref WHERE review_id = :reviewId") 40 | Flowable> findForReview(long reviewId); 41 | 42 | @Query("DELETE FROM reviewtagcrossref WHERE review_id = :reviewId") 43 | Completable deleteByReviewId(long reviewId); 44 | 45 | @Query("DELETE FROM reviewtagcrossref WHERE tag_id = :tagId") 46 | Completable deleteByTagId(long tagId); 47 | 48 | } 49 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 20 | 21 | #673ab7 22 | #9a67ea 23 | #320b86 24 | 25 | #ab47bc 26 | #df78ef 27 | #790e8b 28 | 29 | #f0f0f0 30 | 31 | #ffffff 32 | #ffffff 33 | 34 | 35 | #FFFFFF 36 | #555555 37 | 38 | #FFFFFF 39 | #000000 40 | #D3D3D3 41 | #f0f0f0 42 | #191919 43 | #0f0f0f 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/writer/CSVPrinterWrapper.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.writer; 2 | 3 | import org.apache.commons.csv.CSVFormat; 4 | import org.apache.commons.csv.CSVPrinter; 5 | 6 | import java.io.IOException; 7 | 8 | /** 9 | * CineLog Copyright 2018 Pierre Rognon 10 | * 11 | * 12 | * This file is part of CineLog. 13 | * CineLog is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | * 18 | * CineLog is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | * 23 | * You should have received a copy of the GNU General Public License 24 | * along with CineLog. If not, see . 25 | * 26 | */ 27 | class CSVPrinterWrapper { 28 | 29 | private CSVPrinter csvPrinter; 30 | 31 | public CSVPrinterWrapper(Appendable out, Class> headers) throws IOException { 32 | this.csvPrinter = new CSVPrinter( 33 | out, 34 | CSVFormat.DEFAULT 35 | .withHeader(headers) 36 | .withQuote('`') 37 | .withDelimiter('§')); 38 | } 39 | 40 | public void printRecord(Object... values) throws IOException { 41 | csvPrinter.printRecord(values); 42 | } 43 | 44 | public void close() throws IOException { 45 | csvPrinter.close(); 46 | } 47 | 48 | public void flush() throws IOException { 49 | csvPrinter.flush(); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/ReviewDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Query; 5 | import androidx.room.Transaction; 6 | 7 | import com.ulicae.cinelog.room.entities.ItemEntityType; 8 | import com.ulicae.cinelog.room.entities.Review; 9 | import com.ulicae.cinelog.room.entities.ReviewWithEpisodes; 10 | 11 | import java.util.List; 12 | 13 | import io.reactivex.rxjava3.core.Flowable; 14 | 15 | /** 16 | * CineLog Copyright 2024 Pierre Rognon 17 | *

18 | *

19 | * This file is part of CineLog. 20 | * CineLog is free software: you can redistribute it and/or modify 21 | * it under the terms of the GNU General Public License as published by 22 | * the Free Software Foundation, either version 3 of the License, or 23 | * (at your option) any later version. 24 | *

25 | * CineLog is distributed in the hope that it will be useful, 26 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 27 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 28 | * GNU General Public License for more details. 29 | *

30 | * You should have received a copy of the GNU General Public License 31 | * along with CineLog. If not, see . 32 | */ 33 | @Dao 34 | public interface ReviewDao extends SyncRoomDao { 35 | 36 | @Query("SELECT * FROM review WHERE item_entity_type = :itemEntitytype") 37 | Flowable> findAll(ItemEntityType itemEntitytype); 38 | 39 | @Query("SELECT * FROM review WHERE id = :id") 40 | Flowable find(long id); 41 | 42 | /** 43 | * ReviewWithEpisodes 44 | */ 45 | 46 | @Transaction 47 | @Query("SELECT * FROM Review WHERE Review.tmdb_id = :id") 48 | Flowable getReviewWithEpisodes(Long id); 49 | 50 | } 51 | -------------------------------------------------------------------------------- /app/src/test/java/com/ulicae/cinelog/io/exportdb/exporter/AsyncCsvExporterTest.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.exporter; 2 | 3 | import static org.mockito.Mockito.doReturn; 4 | import static org.mockito.Mockito.verify; 5 | 6 | import com.ulicae.cinelog.room.dto.ItemDto; 7 | import com.ulicae.cinelog.room.services.AsyncDataService; 8 | import com.ulicae.cinelog.io.exportdb.writer.CsvExportWriter; 9 | 10 | import junit.framework.TestCase; 11 | 12 | import org.junit.Test; 13 | import org.junit.runner.RunWith; 14 | import org.mockito.Mock; 15 | import org.mockito.junit.MockitoJUnitRunner; 16 | 17 | import java.io.IOException; 18 | import java.util.ArrayList; 19 | import java.util.List; 20 | 21 | import io.reactivex.rxjava3.core.Flowable; 22 | import io.reactivex.rxjava3.subscribers.TestSubscriber; 23 | 24 | @RunWith(MockitoJUnitRunner.class) 25 | public class AsyncCsvExporterTest extends TestCase { 26 | 27 | @Mock 28 | AsyncDataService service; 29 | 30 | @Mock 31 | CsvExportWriter writer; 32 | 33 | public class DummyDto implements ItemDto { 34 | 35 | @Override 36 | public Long getId() { 37 | return 456L; 38 | } 39 | 40 | @Override 41 | public void setId(Long id) { 42 | } 43 | } 44 | 45 | @Test 46 | public void testExportSucceeded() throws IOException { 47 | DummyDto aDto = new DummyDto(); 48 | doReturn(Flowable.just(new ArrayList() {{ 49 | add(aDto); 50 | }})).when(service).findAll(); 51 | 52 | TestSubscriber> test = new AsyncCsvExporter<>(service, writer) 53 | .export() 54 | .test(); 55 | 56 | test.assertComplete(); 57 | 58 | verify(writer).write(aDto); 59 | verify(writer).endWriting(); 60 | } 61 | 62 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/exporter/TagCsvExporterFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.exporter; 2 | 3 | import com.ulicae.cinelog.KinoApplication; 4 | import com.ulicae.cinelog.room.dto.TagDto; 5 | import com.ulicae.cinelog.room.services.TagAsyncService; 6 | import com.ulicae.cinelog.io.exportdb.writer.TagCsvExportWriter; 7 | 8 | import java.io.FileWriter; 9 | import java.io.IOException; 10 | 11 | /** 12 | * CineLog Copyright 2024 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | public class TagCsvExporterFactory implements ExporterFactory { 30 | 31 | private final TagAsyncService tagService; 32 | 33 | public TagCsvExporterFactory(KinoApplication kinoApplication) { 34 | this(new TagAsyncService(kinoApplication.getDb())); 35 | } 36 | 37 | private TagCsvExporterFactory(TagAsyncService tagService) { 38 | this.tagService = tagService; 39 | } 40 | 41 | public AsyncCsvExporter makeCsvExporter(FileWriter fileWriter) throws IOException { 42 | return new AsyncCsvExporter<>(tagService, new TagCsvExportWriter(fileWriter)); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/dao/WishlistItemDao.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.dao; 2 | 3 | import androidx.room.Dao; 4 | import androidx.room.Insert; 5 | import androidx.room.Query; 6 | 7 | import com.ulicae.cinelog.room.entities.ItemEntityType; 8 | import com.ulicae.cinelog.room.entities.WishlistItem; 9 | 10 | import java.util.List; 11 | 12 | import io.reactivex.rxjava3.core.Completable; 13 | import io.reactivex.rxjava3.core.Flowable; 14 | 15 | 16 | /** 17 | * CineLog Copyright 2024 Pierre Rognon 18 | *

19 | *

20 | * This file is part of CineLog. 21 | * CineLog is free software: you can redistribute it and/or modify 22 | * it under the terms of the GNU General Public License as published by 23 | * the Free Software Foundation, either version 3 of the License, or 24 | * (at your option) any later version. 25 | *

26 | * CineLog is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * GNU General Public License for more details. 30 | *

31 | * You should have received a copy of the GNU General Public License 32 | * along with CineLog. If not, see . 33 | */ 34 | @Dao 35 | public interface WishlistItemDao extends AsyncRoomDao { 36 | 37 | @Query("SELECT * FROM wishlistitem WHERE item_entity_type = :itemEntityType") 38 | Flowable> findAll(ItemEntityType itemEntityType); 39 | 40 | @Query("SELECT * FROM wishlistitem") 41 | Flowable> findAll(); 42 | 43 | @Query("SELECT * FROM wishlistitem WHERE id = :id") 44 | Flowable find(long id); 45 | 46 | @Query("SELECT * FROM wishlistitem WHERE tmdb_id = :tmdbId") 47 | Flowable findByTmdbId(long tmdbId); 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/FileUtilsWrapper.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils; 2 | 3 | import android.os.Environment; 4 | 5 | import java.io.File; 6 | import java.io.FileWriter; 7 | import java.io.IOException; 8 | import java.net.MalformedURLException; 9 | import java.net.URL; 10 | 11 | /** 12 | * CineLog Copyright 2018 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | public class FileUtilsWrapper { 30 | 31 | private File dataDir; 32 | 33 | public FileUtilsWrapper(File dataDir) { 34 | this.dataDir = dataDir; 35 | } 36 | 37 | public File getFilesDir() { 38 | return getAndCreateFile(dataDir.getAbsolutePath()); 39 | } 40 | 41 | public File getFile(String path) { 42 | return new File(path); 43 | } 44 | 45 | public FileWriter getFileWriter(File file) throws IOException { 46 | return new FileWriter(file); 47 | } 48 | 49 | private File getAndCreateFile(String path){ 50 | File file = new File(path); 51 | if (!file.exists()) { 52 | //noinspection ResultOfMethodCallIgnored 53 | file.mkdirs(); 54 | } 55 | return file; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/importdb/ImportInDb.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.importdb; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | import com.ulicae.cinelog.R; 8 | import com.ulicae.cinelog.databinding.V2ImportHostBinding; 9 | import com.ulicae.cinelog.utils.ThemeWrapper; 10 | 11 | /** 12 | * CineLog Copyright 2022 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | public class ImportInDb extends AppCompatActivity { 30 | 31 | @Override 32 | protected void onCreate(Bundle savedInstanceState) { 33 | super.onCreate(savedInstanceState); 34 | new ThemeWrapper().setThemeWithPreferences(this); 35 | 36 | V2ImportHostBinding binding = V2ImportHostBinding.inflate(getLayoutInflater()); 37 | setContentView(binding.getRoot()); 38 | 39 | if (savedInstanceState == null) { 40 | ImportFragment fragment = new ImportFragment(); 41 | getSupportFragmentManager() 42 | .beginTransaction() 43 | .add(R.id.import_host, fragment) 44 | .commit(); 45 | } 46 | } 47 | 48 | 49 | 50 | } 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/test/java/com/ulicae/cinelog/data/dto/TvShowToWishlistDataDtoBuilderTest.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.data.dto; 2 | 3 | import com.ulicae.cinelog.room.dto.data.WishlistDataDto; 4 | import com.ulicae.cinelog.room.dto.data.TvShowToSerieDataDtoBuilder; 5 | import com.ulicae.cinelog.room.dto.data.WishlistItemType; 6 | import com.uwetrottmann.tmdb2.entities.TvShow; 7 | 8 | import org.junit.Test; 9 | import org.junit.runner.RunWith; 10 | import org.mockito.junit.MockitoJUnitRunner; 11 | 12 | import java.text.ParseException; 13 | import java.text.SimpleDateFormat; 14 | 15 | import static org.junit.Assert.assertEquals; 16 | 17 | @RunWith(MockitoJUnitRunner.class) 18 | public class TvShowToWishlistDataDtoBuilderTest { 19 | 20 | @Test 21 | public void build() throws ParseException { 22 | TvShow tvShow = new TvShow(); 23 | tvShow.id = 45; 24 | tvShow.name = "Versailles"; 25 | tvShow.poster_path = "45454545"; 26 | tvShow.overview = "A magic castle"; 27 | tvShow.first_air_date = new SimpleDateFormat("dd/MM/yy").parse("01/10/2015"); 28 | 29 | assertEquals( 30 | new WishlistDataDto(null, 45L, "Versailles", "45454545", "A magic castle", 2015, "01/10/2015", WishlistItemType.SERIE), 31 | new TvShowToSerieDataDtoBuilder().build(tvShow) 32 | ); 33 | } 34 | 35 | @Test 36 | public void build_nullDate() { 37 | TvShow tvShow = new TvShow(); 38 | tvShow.id = 45; 39 | tvShow.name = "Versailles"; 40 | tvShow.poster_path = "45454545"; 41 | tvShow.overview = "A magic castle"; 42 | tvShow.first_air_date = null; 43 | 44 | assertEquals( 45 | new WishlistDataDto(null,45L, "Versailles", "45454545", "A magic castle", 0, null, WishlistItemType.SERIE), 46 | new TvShowToSerieDataDtoBuilder().build(tvShow) 47 | ); 48 | } 49 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_review_serie_item.xml: -------------------------------------------------------------------------------- 1 | 18 | 24 | 25 | 29 | 30 | 36 | 37 | 38 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/ShareableFragment.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments; 2 | 3 | import android.content.Intent; 4 | import android.view.Menu; 5 | import android.view.MenuInflater; 6 | import android.view.MenuItem; 7 | 8 | import androidx.annotation.NonNull; 9 | import androidx.fragment.app.Fragment; 10 | 11 | import com.ulicae.cinelog.R; 12 | import com.ulicae.cinelog.room.dto.TmdbItemDto; 13 | 14 | public abstract class ShareableFragment extends Fragment { 15 | 16 | private String linkBaseUrl; 17 | 18 | protected T item; 19 | 20 | @Override 21 | public void onCreateOptionsMenu(@NonNull Menu menu, @NonNull MenuInflater inflater) { 22 | super.onCreateOptionsMenu(menu, inflater); 23 | inflater.inflate(R.menu.menu_review, menu); 24 | } 25 | 26 | @Override 27 | public boolean onOptionsItemSelected(MenuItem item) { 28 | if (item.getItemId() == R.id.action_share) { 29 | shareMovie(); 30 | return true; 31 | } 32 | return true; 33 | } 34 | 35 | private void shareMovie() { 36 | if (this.item.getTmdbKinoId() == null) { 37 | shareText(this.item.getTitle()); 38 | } else { 39 | shareText(linkBaseUrl + this.item.getTmdbKinoId()); 40 | } 41 | } 42 | private void shareText(String text) { 43 | Intent sendIntent = new Intent(); 44 | sendIntent.setAction(Intent.ACTION_SEND); 45 | sendIntent.putExtra(Intent.EXTRA_TEXT, text); 46 | sendIntent.setType("text/plain"); 47 | 48 | Intent shareIntent = Intent.createChooser(sendIntent, null); 49 | startActivity(shareIntent); 50 | } 51 | 52 | protected void setLinkBaseUrl(String url) { 53 | this.linkBaseUrl = url; 54 | } 55 | 56 | protected void addOptionMenu() { 57 | setHasOptionsMenu(true); 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/ExportDb.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb; 2 | 3 | import android.os.Bundle; 4 | 5 | import androidx.appcompat.app.AppCompatActivity; 6 | 7 | import com.ulicae.cinelog.R; 8 | import com.ulicae.cinelog.databinding.ActivityExportDbBinding; 9 | import com.ulicae.cinelog.databinding.V2ExportHostBinding; 10 | import com.ulicae.cinelog.utils.ThemeWrapper; 11 | 12 | /** 13 | * CineLog Copyright 2022 Pierre Rognon 14 | *

15 | *

16 | * This file is part of CineLog. 17 | * CineLog is free software: you can redistribute it and/or modify 18 | * it under the terms of the GNU General Public License as published by 19 | * the Free Software Foundation, either version 3 of the License, or 20 | * (at your option) any later version. 21 | *

22 | * CineLog is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | *

27 | * You should have received a copy of the GNU General Public License 28 | * along with CineLog. If not, see . 29 | */ 30 | public class ExportDb extends AppCompatActivity { 31 | 32 | @Override 33 | protected void onCreate(Bundle savedInstanceState) { 34 | super.onCreate(savedInstanceState); 35 | new ThemeWrapper().setThemeWithPreferences(this); 36 | 37 | V2ExportHostBinding binding = V2ExportHostBinding.inflate(getLayoutInflater()); 38 | setContentView(binding.getRoot()); 39 | 40 | if (savedInstanceState == null) { 41 | ExportFragment fragment = new ExportFragment(); 42 | getSupportFragmentManager() 43 | .beginTransaction() 44 | .add(R.id.export_host, fragment) 45 | .commit(); 46 | } 47 | } 48 | 49 | 50 | } 51 | 52 | 53 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/network/task/MovieNetworkTask.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.network.task; 2 | 3 | import com.ulicae.cinelog.android.v2.fragments.review.room.tmdbsearch.SearchTmdbFragment; 4 | import com.ulicae.cinelog.android.v2.fragments.review.room.tmdbsearch.SearchTmdbMovieFragment; 5 | import com.uwetrottmann.tmdb2.entities.BaseMovie; 6 | import com.uwetrottmann.tmdb2.entities.Movie; 7 | import com.uwetrottmann.tmdb2.entities.MovieResultsPage; 8 | 9 | import java.util.List; 10 | 11 | import retrofit2.Response; 12 | 13 | /** 14 | * CineLog Copyright 2018 Pierre Rognon 15 | * kinolog Copyright (C) 2017 ryan rigby 16 | *

17 | *

18 | * This file is part of CineLog. 19 | * CineLog is free software: you can redistribute it and/or modify 20 | * it under the terms of the GNU General Public License as published by 21 | * the Free Software Foundation, either version 3 of the License, or 22 | * (at your option) any later version. 23 | *

24 | * CineLog is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * GNU General Public License for more details. 28 | *

29 | * You should have received a copy of the GNU General Public License 30 | * along with CineLog. If not, see . 31 | */ 32 | public class MovieNetworkTask extends NetworkTask { 33 | 34 | MovieNetworkTask(SearchTmdbFragment searchTmdbFragment) { 35 | super(searchTmdbFragment); 36 | } 37 | 38 | @Override 39 | List getResults(Response response) { 40 | return response.body().results; 41 | } 42 | 43 | @Override 44 | void populateListView(List movies) { 45 | ((SearchTmdbMovieFragment) getAddReviewFragmentWeakReference().get()).populateListView(movies); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/network/task/TvNetworkTask.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.network.task; 2 | 3 | import com.ulicae.cinelog.android.v2.fragments.review.room.tmdbsearch.SearchTmdbFragment; 4 | import com.ulicae.cinelog.android.v2.fragments.review.room.tmdbsearch.SearchTmbdSerieFragment; 5 | import com.uwetrottmann.tmdb2.entities.BaseTvShow; 6 | import com.uwetrottmann.tmdb2.entities.TvShow; 7 | import com.uwetrottmann.tmdb2.entities.TvShowResultsPage; 8 | 9 | import java.util.List; 10 | 11 | import retrofit2.Response; 12 | 13 | /** 14 | * CineLog Copyright 2018 Pierre Rognon 15 | * kinolog Copyright (C) 2017 ryan rigby 16 | *

17 | *

18 | * This file is part of CineLog. 19 | * CineLog is free software: you can redistribute it and/or modify 20 | * it under the terms of the GNU General Public License as published by 21 | * the Free Software Foundation, either version 3 of the License, or 22 | * (at your option) any later version. 23 | *

24 | * CineLog is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * GNU General Public License for more details. 28 | *

29 | * You should have received a copy of the GNU General Public License 30 | * along with CineLog. If not, see . 31 | */ 32 | public class TvNetworkTask extends NetworkTask { 33 | 34 | TvNetworkTask(SearchTmdbFragment searchTmdbFragment) { 35 | super(searchTmdbFragment); 36 | } 37 | 38 | @Override 39 | List getResults(Response response) { 40 | return response.body().results; 41 | } 42 | 43 | @Override 44 | void populateListView(List movies) { 45 | ((SearchTmbdSerieFragment) getAddReviewFragmentWeakReference().get()).populateListView(movies); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/test/java/com/ulicae/cinelog/android/v2/fragments/review/edit/WishlistItemDeleterTest.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.edit; 2 | 3 | import static org.mockito.Mockito.doReturn; 4 | import static org.mockito.Mockito.verify; 5 | 6 | import com.ulicae.cinelog.room.dto.data.WishlistDataDto; 7 | import com.ulicae.cinelog.room.services.WishlistAsyncService; 8 | 9 | import org.junit.Test; 10 | import org.junit.runner.RunWith; 11 | import org.mockito.Mock; 12 | import org.mockito.junit.MockitoJUnitRunner; 13 | 14 | import io.reactivex.rxjava3.core.Flowable; 15 | 16 | /** 17 | * CineLog Copyright 2019 Pierre Rognon 18 | * 19 | * 20 | * This file is part of CineLog. 21 | * CineLog is free software: you can redistribute it and/or modify 22 | * it under the terms of the GNU General Public License as published by 23 | * the Free Software Foundation, either version 3 of the License, or 24 | * (at your option) any later version. 25 | * 26 | * CineLog is distributed in the hope that it will be useful, 27 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 28 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 29 | * GNU General Public License for more details. 30 | * 31 | * You should have received a copy of the GNU General Public License 32 | * along with CineLog. If not, see . 33 | * 34 | */ 35 | @RunWith(MockitoJUnitRunner.class) 36 | public class WishlistItemDeleterTest { 37 | 38 | @Mock 39 | private WishlistAsyncService wishlistAsyncService; 40 | 41 | @Mock 42 | private WishlistDataDto wishlistDataDto; 43 | 44 | 45 | @Test 46 | public void deleteWishlistItem() { 47 | doReturn(Flowable.just(wishlistDataDto)).when(wishlistAsyncService).findById(1564L); 48 | 49 | new WishlistItemDeleter(wishlistAsyncService).deleteWishlistItem(1564L); 50 | 51 | verify(wishlistAsyncService).delete(wishlistDataDto); 52 | } 53 | 54 | } -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/review/add/TmdbMovieResultsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.add; 2 | 3 | import android.content.Context; 4 | 5 | import com.ulicae.cinelog.KinoApplication; 6 | import com.ulicae.cinelog.network.KinoBuilderFromMovie; 7 | import com.ulicae.cinelog.room.entities.ItemEntityType; 8 | import com.ulicae.cinelog.room.services.ReviewAsyncService; 9 | import com.uwetrottmann.tmdb2.entities.BaseMovie; 10 | 11 | import java.util.List; 12 | 13 | 14 | /** 15 | * CineLog Copyright 2018 Pierre Rognon 16 | *

17 | *

18 | * This file is part of CineLog. 19 | * CineLog is free software: you can redistribute it and/or modify 20 | * it under the terms of the GNU General Public License as published by 21 | * the Free Software Foundation, either version 3 of the License, or 22 | * (at your option) any later version. 23 | *

24 | * CineLog is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * GNU General Public License for more details. 28 | *

29 | * You should have received a copy of the GNU General Public License 30 | * along with CineLog. If not, see . 31 | */ 32 | public class TmdbMovieResultsAdapter extends TmdbResultAdapter { 33 | 34 | public TmdbMovieResultsAdapter(Context context, KinoApplication app, List results, 35 | ReviewItemCallback reviewItemCallback, 36 | ReviewCreationCallback reviewCreationCallback) { 37 | super(context, 38 | results, 39 | new ReviewAsyncService(app, ItemEntityType.MOVIE), 40 | new KinoBuilderFromMovie(), 41 | reviewItemCallback, 42 | reviewCreationCallback); 43 | } 44 | 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/fragments/wishlist/add/WishlistTvRoomResultsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.fragments.wishlist.add; 2 | 3 | import android.content.Context; 4 | 5 | import com.ulicae.cinelog.room.dto.data.TvShowToSerieDataDtoBuilder; 6 | import com.ulicae.cinelog.room.dto.data.WishlistDataDto; 7 | import com.uwetrottmann.tmdb2.entities.BaseTvShow; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * CineLog Copyright 2024 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | public class WishlistTvRoomResultsAdapter extends WishlistRoomResultsAdapter { 30 | 31 | private TvShowToSerieDataDtoBuilder tvShowToSerieDataDtoBuilder; 32 | 33 | 34 | public WishlistTvRoomResultsAdapter(Context context, List results, WishlistItemCallback wishlistItemCallback) { 35 | super(context, results, wishlistItemCallback); 36 | this.tvShowToSerieDataDtoBuilder = new TvShowToSerieDataDtoBuilder(); 37 | } 38 | 39 | @Override 40 | protected WishlistDataDto build(BaseTvShow item) { 41 | return tvShowToSerieDataDtoBuilder.build(item); 42 | } 43 | 44 | @Override 45 | protected int getId(BaseTvShow item) { 46 | return item.id; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/res/layout/review_list_year_row.xml: -------------------------------------------------------------------------------- 1 | 18 | 24 | 25 | 34 | 35 | 42 | 43 | 44 | 45 | -------------------------------------------------------------------------------- /app/src/main/res/layout/nav_header.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 13 | 14 | 19 | 20 | 25 | 26 | 35 | 36 | 45 | 46 | 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/utils/image/CacheImageDownloaderNetworkTask.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.utils.image; 2 | 3 | import android.os.AsyncTask; 4 | 5 | import org.apache.commons.io.FileUtils; 6 | 7 | import java.io.File; 8 | import java.io.IOException; 9 | import java.net.URL; 10 | 11 | import static com.ulicae.cinelog.utils.image.ImageCacheDownloader.BASE_URL; 12 | 13 | /** 14 | * CineLog Copyright 2018 Pierre Rognon 15 | *

16 | *

17 | * This file is part of CineLog. 18 | * CineLog is free software: you can redistribute it and/or modify 19 | * it under the terms of the GNU General Public License as published by 20 | * the Free Software Foundation, either version 3 of the License, or 21 | * (at your option) any later version. 22 | *

23 | * CineLog is distributed in the hope that it will be useful, 24 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 25 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 26 | * GNU General Public License for more details. 27 | *

28 | * You should have received a copy of the GNU General Public License 29 | * along with CineLog. If not, see . 30 | */ 31 | class CacheImageDownloaderNetworkTask extends AsyncTask { 32 | 33 | private final File cacheDir; 34 | private final String imagePath; 35 | 36 | CacheImageDownloaderNetworkTask(File cacheDir, String imagePath) { 37 | this.cacheDir = cacheDir; 38 | this.imagePath = imagePath; 39 | } 40 | 41 | @Override 42 | protected Void doInBackground(Void... voids) { 43 | File fileToWrite = new ImageCacheFinder(cacheDir).getImage(imagePath); 44 | try { 45 | FileUtils.copyURLToFile(new URL(BASE_URL + imagePath), fileToWrite); 46 | } catch (IOException e) { 47 | //noinspection ResultOfMethodCallIgnored 48 | fileToWrite.delete(); 49 | } 50 | 51 | return null; 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /fastlane/metadata/android/fr-FR/full_description.txt: -------------------------------------------------------------------------------- 1 | Rédigez vos avis et notez les films et séries que vous avez vus. Créez votre base de données d'avis de films ! 2 | 3 | Fonctionnalités: 4 | 5 |

    6 |
  • Recherchez les films et les séries que vous voulez via l'API [https://www.themoviedb.org/ tmdb.org];
  • 7 |
  • Choisissez la langue dans laquelle vous voulez afficher les informations de tmdb;
  • 8 |
  • Créez un avis dans votre base de données à partir du film ou de la série trouvée;
  • 9 |
  • Créez un avis sur un film inexistant dans la base tmdb;
  • 10 |
  • Choisissez votre échelle de notation;
  • 11 |
  • Enregistrez les films et séries que vous voulez voir;
  • 12 |
  • Enregistrez votre avancement dans les épisodes d'une série;
  • 13 |
  • Catégorisez vos films et séries à l'aide des tags;
  • 14 |
  • Exportez la base de données au format CSV;
  • 15 |
  • Importez une base de données existante au format CSV.
  • 16 |
  • Activez la sauvegarde locale automatique au format CSV (peut permettre une synchronisation avec un client cloud).
  • 17 |
18 | 19 | Permissions: 20 | 21 |
    22 |
  • INTERNET pour accéder à l'API tmdb
  • 23 |
  • ACCESS_NETWORK_STATE afin de savoir si vous êtes connectés à Internet ou non
  • 24 |
  • READ_EXTERNAL_STORAGE pour lire un fichier CSV à importer
  • 25 |
  • WRITE_EXTERNAL_STORAGE pour exporter votre base de données au format CSV sur votre appareil
  • 26 |
27 | 28 | Remerciements: 29 | 30 | Merci à Christopher Bodtke pour la traduction allemande de l'application. 31 | Merci à Diego Sangunietti pour la traduction espagnole de l'application. 32 | Merci à verahawk pour la traduction polonaise de l'application. 33 | Merci à Vistaus pour la traduction hollandaise de l'application. 34 | Merci à sr093906 pour la traduction chinoise de l'application. 35 | 36 | 37 | Merci à Kertin Maur pour l'icône de l'application et la proposition de couleurs. 38 | 39 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/review/add/TmdbTvResultsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.add; 2 | 3 | 4 | import android.content.Context; 5 | 6 | import com.ulicae.cinelog.KinoApplication; 7 | import com.ulicae.cinelog.network.SerieBuilderFromMovie; 8 | import com.ulicae.cinelog.room.entities.ItemEntityType; 9 | import com.ulicae.cinelog.room.services.ReviewAsyncService; 10 | import com.uwetrottmann.tmdb2.entities.BaseTvShow; 11 | 12 | import java.util.List; 13 | 14 | /** 15 | * CineLog Copyright 2018 Pierre Rognon 16 | * 17 | * 18 | * This file is part of CineLog. 19 | * CineLog is free software: you can redistribute it and/or modify 20 | * it under the terms of the GNU General Public License as published by 21 | * the Free Software Foundation, either version 3 of the License, or 22 | * (at your option) any later version. 23 | * 24 | * CineLog is distributed in the hope that it will be useful, 25 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 26 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 27 | * GNU General Public License for more details. 28 | * 29 | * You should have received a copy of the GNU General Public License 30 | * along with CineLog. If not, see . 31 | * 32 | */ 33 | public class TmdbTvResultsAdapter extends TmdbResultAdapter { 34 | 35 | public TmdbTvResultsAdapter(Context context, 36 | KinoApplication app, 37 | List results, 38 | ReviewItemCallback reviewItemCallback, 39 | ReviewCreationCallback reviewCreationCallback) { 40 | super(context, 41 | results, 42 | new ReviewAsyncService(app, ItemEntityType.SERIE), 43 | new SerieBuilderFromMovie(), 44 | reviewItemCallback, reviewCreationCallback); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/exporter/ReviewCsvExporterFactory.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.exporter; 2 | 3 | import com.ulicae.cinelog.KinoApplication; 4 | import com.ulicae.cinelog.room.dto.KinoDto; 5 | import com.ulicae.cinelog.io.exportdb.writer.ReviewCsvExportWriter; 6 | import com.ulicae.cinelog.room.entities.ItemEntityType; 7 | import com.ulicae.cinelog.room.services.ReviewAsyncService; 8 | 9 | import java.io.FileWriter; 10 | import java.io.IOException; 11 | 12 | /** 13 | * CineLog Copyright 2024 Pierre Rognon 14 | *

15 | *

16 | * This file is part of CineLog. 17 | * CineLog is free software: you can redistribute it and/or modify 18 | * it under the terms of the GNU General Public License as published by 19 | * the Free Software Foundation, either version 3 of the License, or 20 | * (at your option) any later version. 21 | *

22 | * CineLog is distributed in the hope that it will be useful, 23 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 24 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 25 | * GNU General Public License for more details. 26 | *

27 | * You should have received a copy of the GNU General Public License 28 | * along with CineLog. If not, see . 29 | */ 30 | public class ReviewCsvExporterFactory implements ExporterFactory { 31 | 32 | private final ReviewAsyncService reviewService; 33 | 34 | public ReviewCsvExporterFactory(KinoApplication kinoApplication, ItemEntityType itemEntityType) { 35 | this(new ReviewAsyncService(kinoApplication, itemEntityType)); 36 | } 37 | 38 | private ReviewCsvExporterFactory(ReviewAsyncService reviewService) { 39 | this.reviewService = reviewService; 40 | } 41 | 42 | public AsyncCsvExporter makeCsvExporter(FileWriter fileWriter) throws IOException { 43 | return new AsyncCsvExporter<>(reviewService, new ReviewCsvExportWriter(fileWriter)); 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /app/src/main/res/layout/toolbar_new.xml: -------------------------------------------------------------------------------- 1 | 18 | 23 | 24 | 33 | 34 | 39 | 40 | 41 | 42 | 43 | 44 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/entities/WishlistItem.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.entities; 2 | 3 | import androidx.room.ColumnInfo; 4 | import androidx.room.Embedded; 5 | import androidx.room.Entity; 6 | import androidx.room.PrimaryKey; 7 | 8 | import java.util.Objects; 9 | 10 | 11 | @Entity 12 | public class WishlistItem { 13 | 14 | @PrimaryKey(autoGenerate = true) 15 | public long id; 16 | 17 | @ColumnInfo(name = "item_entity_type") 18 | public ItemEntityType itemEntityType; 19 | 20 | public String title; 21 | 22 | @Embedded 23 | public Tmdb tmdb; 24 | 25 | public WishlistItem(long id, ItemEntityType itemEntityType, String title, Tmdb tmdb) { 26 | this.id = id; 27 | this.itemEntityType = itemEntityType; 28 | this.title = title; 29 | this.tmdb = tmdb; 30 | } 31 | 32 | public long getId() { 33 | return id; 34 | } 35 | 36 | public ItemEntityType getItemEntityType() { 37 | return itemEntityType; 38 | } 39 | 40 | public String getTitle() { 41 | return title; 42 | } 43 | 44 | public Tmdb getTmdb() { 45 | return tmdb; 46 | } 47 | 48 | @Override 49 | public boolean equals(Object o) { 50 | if (this == o) return true; 51 | if (o == null || getClass() != o.getClass()) return false; 52 | WishlistItem item = (WishlistItem) o; 53 | return id == item.id && itemEntityType == item.itemEntityType && Objects.equals(title, item.title) && Objects.equals(tmdb, item.tmdb); 54 | } 55 | 56 | @Override 57 | public int hashCode() { 58 | return Objects.hash(id, itemEntityType, title, tmdb); 59 | } 60 | 61 | @Override 62 | public String toString() { 63 | return "WishlistItem{" + 64 | "id=" + id + 65 | ", itemEntityType=" + itemEntityType + 66 | ", title='" + title + '\'' + 67 | ", tmdb=" + tmdb + 68 | '}'; 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/room/fragments/wishlist/add/WishlistMovieRoomResultsAdapter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.room.fragments.wishlist.add; 2 | 3 | import android.content.Context; 4 | 5 | import com.ulicae.cinelog.room.dto.data.MovieToWishlistDataDtoBuilder; 6 | import com.ulicae.cinelog.room.dto.data.WishlistDataDto; 7 | import com.uwetrottmann.tmdb2.entities.BaseMovie; 8 | 9 | import java.util.List; 10 | 11 | /** 12 | * CineLog Copyright 2024 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | // TODO generic with WishlistTvResultsAdapter 30 | public class WishlistMovieRoomResultsAdapter extends WishlistRoomResultsAdapter { 31 | 32 | private MovieToWishlistDataDtoBuilder movieToWishlistDataDtoBuilder; 33 | 34 | public WishlistMovieRoomResultsAdapter(Context context, List results, WishlistItemCallback wishlistItemCallback) { 35 | super(context, results, wishlistItemCallback); 36 | this.movieToWishlistDataDtoBuilder = new MovieToWishlistDataDtoBuilder(); 37 | } 38 | 39 | @Override 40 | protected WishlistDataDto build(BaseMovie item) { 41 | return movieToWishlistDataDtoBuilder.build(item); 42 | } 43 | 44 | @Override 45 | protected int getId(BaseMovie item) { 46 | return item.id; 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/android/v2/fragments/review/item/serie/TvEpisodeViewHolder.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.android.v2.fragments.review.item.serie; 2 | 3 | import android.widget.ImageView; 4 | import android.widget.TextView; 5 | 6 | import com.ulicae.cinelog.databinding.SerieEpisodeResultItemBinding; 7 | 8 | /** 9 | * CineLog Copyright 2022 Pierre Rognon 10 | *

11 | *

12 | * This file is part of CineLog. 13 | * CineLog is free software: you can redistribute it and/or modify 14 | * it under the terms of the GNU General Public License as published by 15 | * the Free Software Foundation, either version 3 of the License, or 16 | * (at your option) any later version. 17 | *

18 | * CineLog is distributed in the hope that it will be useful, 19 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 20 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 21 | * GNU General Public License for more details. 22 | *

23 | * You should have received a copy of the GNU General Public License 24 | * along with CineLog. If not, see . 25 | */ 26 | class TvEpisodeViewHolder { 27 | 28 | private final SerieEpisodeResultItemBinding binding; 29 | 30 | TvEpisodeViewHolder(SerieEpisodeResultItemBinding binding) { 31 | this.binding = binding; 32 | } 33 | 34 | public TextView getEpisodeName() { 35 | return binding.serieEpisodeItemName; 36 | } 37 | 38 | public TextView getEpisodeDate() { 39 | return binding.serieEpisodeItemDate; 40 | } 41 | 42 | public TextView getSeasonNumber() { 43 | return binding.serieEpisodeItemSeasonNumber; 44 | } 45 | 46 | public TextView getEpisodeNumber() { 47 | return binding.serieEpisodeItemEpisodeNumber; 48 | } 49 | 50 | public ImageView getEpisodeWatched() { 51 | return binding.serieEpisodeItemWatched; 52 | } 53 | 54 | public TextView getEpisodeWatchingDate() { 55 | return binding.serieEpisodeItemWatchingDate; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /app/src/main/java/com/ulicae/cinelog/io/exportdb/exporter/AsyncCsvExporter.java: -------------------------------------------------------------------------------- 1 | package com.ulicae.cinelog.io.exportdb.exporter; 2 | 3 | import com.ulicae.cinelog.room.dto.ItemDto; 4 | import com.ulicae.cinelog.room.services.AsyncDataService; 5 | import com.ulicae.cinelog.io.exportdb.writer.CsvExportWriter; 6 | 7 | import java.util.List; 8 | 9 | import io.reactivex.rxjava3.core.Flowable; 10 | 11 | /** 12 | * CineLog Copyright 2024 Pierre Rognon 13 | *

14 | *

15 | * This file is part of CineLog. 16 | * CineLog is free software: you can redistribute it and/or modify 17 | * it under the terms of the GNU General Public License as published by 18 | * the Free Software Foundation, either version 3 of the License, or 19 | * (at your option) any later version. 20 | *

21 | * CineLog is distributed in the hope that it will be useful, 22 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 23 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 24 | * GNU General Public License for more details. 25 | *

26 | * You should have received a copy of the GNU General Public License 27 | * along with CineLog. If not, see . 28 | */ 29 | public class AsyncCsvExporter implements CsvExporter { 30 | private final AsyncDataService service; 31 | private final CsvExportWriter csvExportWriter; 32 | 33 | AsyncCsvExporter(AsyncDataService service, CsvExportWriter csvExportWriter) { 34 | this.service = service; 35 | this.csvExportWriter = csvExportWriter; 36 | } 37 | 38 | public Flowable> export() { 39 | return service 40 | .findAll() 41 | .doOnNext( 42 | dtos -> { 43 | for (T dto : dtos) { 44 | csvExportWriter.write(dto); 45 | } 46 | 47 | csvExportWriter.endWriting(); 48 | } 49 | ); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /app/src/main/res/layout/content_export_db.xml: -------------------------------------------------------------------------------- 1 | 2 | 19 | 31 | 32 | 37 | 38 |