Skip to content

Commit

Permalink
Fix Threads platform name and move thead to social network
Browse files Browse the repository at this point in the history
  • Loading branch information
Ziedelth committed Feb 29, 2024
1 parent c1c608c commit a7392bd
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
37 changes: 17 additions & 20 deletions src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,7 @@ class FetchEpisodesJob : AbstractJob {

if (savedEpisodes.isNotEmpty() && savedEpisodes.size < configCacheService.getValueAsInt(ConfigPropertyKey.SOCIAL_NETWORK_EPISODES_SIZE_LIMIT)) {
val dtos = AbstractConverter.convert(savedEpisodes, EpisodeDto::class.java)

dtos.forEach {
Thread {
sendToSocialNetworks(it)
}.start()
}
dtos.forEach { sendToSocialNetworks(it) }

Check warning on line 85 in src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt#L85

Added line #L85 was not covered by tests
}

isRunning = false
Expand All @@ -104,20 +99,22 @@ class FetchEpisodesJob : AbstractJob {
}

Constant.abstractSocialNetworks.forEach { socialNetwork ->
try {
socialNetwork.sendEpisodeRelease(dto, mediaImage)
} catch (e: Exception) {
logger.log(
Level.SEVERE,
"Error while sending episode release for ${
socialNetwork.javaClass.simpleName.replace(
"SocialNetwork",
""
)
}",
e
)
}
Thread {
try {
socialNetwork.sendEpisodeRelease(dto, mediaImage)
} catch (e: Exception) {
logger.log(
Level.SEVERE,

Check warning on line 107 in src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt#L102-L107

Added lines #L102 - L107 were not covered by tests
"Error while sending episode release for ${
socialNetwork.javaClass.simpleName.replace(
"SocialNetwork",
""

Check warning on line 111 in src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt#L109-L111

Added lines #L109 - L111 were not covered by tests
)
}",
e

Check warning on line 114 in src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt#L114

Added line #L114 was not covered by tests
)
}
}.start()

Check warning on line 117 in src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/fr/shikkanime/jobs/FetchEpisodesJob.kt#L117

Added line #L117 was not covered by tests
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class ThreadsSocialNetwork : AbstractSocialNetwork() {
Platform.CRUN -> "@crunchyroll_fr"
Platform.NETF -> "@netflixfr"
Platform.PRIM -> "@primevideofr"
else -> platform.name
else -> platform.platformName

Check warning on line 74 in src/main/kotlin/fr/shikkanime/socialnetworks/ThreadsSocialNetwork.kt

View check run for this annotation

Codecov / codecov/patch

src/main/kotlin/fr/shikkanime/socialnetworks/ThreadsSocialNetwork.kt#L74

Added line #L74 was not covered by tests
}
}

Expand Down

0 comments on commit a7392bd

Please sign in to comment.