From: Vásáry Dániel Date: Tue, 5 Dec 2023 21:27:31 +0000 (+0100) Subject: UI extended, scheduled execution built in X-Git-Url: http://git.useribm.hu/?a=commitdiff_plain;h=d963e3db6cfbff28f191e2220b2123551ebdc40c;p=mediacube.git UI extended, scheduled execution built in --- diff --git a/mc-vod-sync/QUESTIONS.md b/mc-vod-sync/QUESTIONS.md index 196c36f8..d1c780a2 100644 --- a/mc-vod-sync/QUESTIONS.md +++ b/mc-vod-sync/QUESTIONS.md @@ -1,6 +1,33 @@ -* A custom fields API kellhet? Ott be lehet állítani a custom filed-re pl. azt, hogy kötelező e, így amíg nincs értéke +actors_talent, Actors/Talent, , string, null required: false +director, Director, , string, null required: false +episode, Episode, , +enum, [1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 21, 22, 23, 24, 25, 26, 3, 4, 5, 6, 7, 8, 9] required: false +genre, Genre, , enum, [Novel, Spektrum saját gyártás, Thriller, action, adnimation, adult, adventure, animals, comedy] +required: false +notes, Notes, , string, null required: false +parent_network, Parent Network, , enum, [AMC+ Hungary (Selekt), Selekt] required: false +production_year, Production Year, , string, null required: false +rating_tv, Rating TV, , enum, [18, 18+] required: false +season, Season, , enum, [1, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 2, 20, 3, 4, 5, 6, 7, 8, 9, Special] required: false +show, Show, , string, null required: false +tms_episode_id, TMS Episode ID, , string, null required: false +tms_movie_id, TMS Movie ID, , string, null required: false +tms_series_id, TMS Series ID, , string, null required: false +tms_season_id, TMS Season ID, , string, null required: false +video_category, Video Category, , enum, [Movie, Series] required: false +video_type, Video Type, , enum, [Full Episode, Full Movie, Sports] required: false +s3_captions_url, S3 Captions URL, , string, null required: false +s3_video_url, S3 Video URL, , string, null required: false +downloadable, Downloadable, , enum, [NO, YES] required: false +MaxCustomFields: 30 + +- Az age_rating jelenleg 18,18+. Adjam hozzá az újakat, vagy dobjam el a nem jó értékeket? A többi enumra is ez a + kérdés (episode, season) +- Mit jelent a season Special? +- A playlist neve nem kötelezően egyedi, de kezelhető egyedinek? Az update miatt érdekes (episode, season) +- A custom fields API kellhet? Ott be lehet állítani a custom filed-re pl. azt, hogy kötelező e, így amíg nincs értéke addig a videó nem aktív. Ennek használata nélkül is létrehozható video? -* + * A sunset kezelése is kell, tehát jöhet adat későbbi sunset-el? * A sunset és sunrise formátuma legyen egyforma (mindegy melyik) minden sorra! * Mik a kötelező mezők? Most: playlist, sunset, sunrise, title diff --git a/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml b/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml index 7a5ee750..e5fc5a9c 100644 --- a/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml +++ b/mc-vod-sync/mc-vod-sync-app/src/main/resources/application-dev.yaml @@ -34,11 +34,20 @@ spring: logging: level: org.hibernate.engine.jdbc.spi.SqlExceptionHelper: ERROR +# org.springframework.web.client.RestTemplate: DEBUG +# org.apache.http: DEBUG +# httpclient.wire: DEBUG mc-vod-sync: - scheduler: - import: true - export: true - sunrise-checker: true + service: + target-video-insert-enabled: true + target-playlist-insert-enabled: true + scheduler: + import-enabled: false + export-enabled: false + sunrise-checker-enabled: false + import-cron: 0 0 4 1/1 * ? * + export-cron: 0 0 4 1/1 * ? * + sunrise-checker-cron: 0 0 4 1/1 * ? * application: user-name: user password: password diff --git a/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/AssetImportExportBase.java b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/AssetImportExportBase.java index 7d50548a..050b363e 100644 --- a/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/AssetImportExportBase.java +++ b/mc-vod-sync/mc-vod-sync-app/src/test/java/hu/user/mcvodsync/AssetImportExportBase.java @@ -5,13 +5,21 @@ package hu.user.mcvodsync; +import com.brightcove.cms.client.model.Playlist; +import com.brightcove.cms.client.model.Video; +import hu.user.mcvodsync.brightcove.BrightCoveClient; +import hu.user.mcvodsync.brightcove.PagedSearch; +import hu.user.mcvodsync.db.Asset; import hu.user.mcvodsync.db.PlaylistSync; import hu.user.mcvodsync.db.SyncType; import hu.user.mcvodsync.db.repository.AssetRepository; import hu.user.mcvodsync.db.repository.AssetSyncRepository; import hu.user.mcvodsync.db.repository.PlaylistSyncRepository; +import hu.user.mcvodsync.service.in.AssetImportService; import hu.user.mcvodsync.service.in.ImportSummary; import hu.user.mcvodsync.service.in.VodXlsProcessor; +import hu.user.mcvodsync.service.out.AssetExportService; +import hu.user.mcvodsync.service.out.VideoMapper; import lombok.extern.log4j.Log4j2; import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; @@ -21,8 +29,12 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; +import java.util.Map; +import java.util.Objects; +import java.util.stream.Collectors; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertNotNull; @Log4j2 @@ -39,6 +51,18 @@ public class AssetImportExportBase { @Autowired private PlaylistSyncRepository playlistSyncRepository; + @Autowired + private AssetImportService assetImportService; + + @Autowired + private AssetExportService assetExportService; + + @Autowired + private BrightCoveClient brightCoveClient; + + @Autowired + private VideoMapper videoMapper; + protected String getPlaylistSyncIds(String name) { List playlists = playlistSyncRepository.findAllByName(name); assertEquals(1, playlists.size()); @@ -46,17 +70,64 @@ public class AssetImportExportBase { } protected void cleanup() { - cleanupSync(); + cleanupLocal(); + cleanupRemote(); assetRepository.deleteAllInBatch(); } - protected void cleanupSync() { + protected void cleanupRemote() { + log.info("cleanupRemote"); + cleanupRemotePlaylists(); + cleanupRemoteVideos(); + log.info("cleanupRemote OK"); + } + + private void cleanupRemoteVideos() { + PagedSearch