-
Notifications
You must be signed in to change notification settings - Fork 27
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature/performant old filmlist reader #150
base: develop
Are you sure you want to change the base?
Conversation
SonarCloud Quality Gate failed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Didn't had the time to have a look at the unit tests. I will do it later.
src/main/java/de/mediathekview/mlib/filmlisten/reader/FilmlistOldFormatReader.java
Outdated
Show resolved
Hide resolved
src/main/java/de/mediathekview/mlib/filmlisten/reader/OldFilmlistToRawFilmlistReader.java
Outdated
Show resolved
Hide resolved
src/main/java/de/mediathekview/mlib/filmlisten/reader/OldFilmlistToRawFilmlistReader.java
Outdated
Show resolved
Hide resolved
import static java.time.format.FormatStyle.MEDIUM; | ||
|
||
@Mapper | ||
public interface RawFilmToFilmMapper { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, lets talk about the mapper :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure :)
@@ -1,6 +1,13 @@ | |||
<?xml version="1.0" encoding="UTF-8"?> | |||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |||
<modelVersion>4.0.0</modelVersion> | |||
<parent> | |||
<groupId>org.springframework.boot</groupId> | |||
<artifactId>spring-boot-starter-parent</artifactId> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wieso Spring Boot? wird doch in MLib gar nicht verwendet.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Im spring Boot parent sind für viele Abhängigkeiten die Versionen aufeinander abgestimmt und getestet. Wenn wir den, wie hier von mir getan, nutzen müssen wir uns nicht um Kompatibilität einzelner Versionen zueinander kümmern. Zum updaten von dependencies können wir so auch "einfach" die Spring version erhöhen und müssen uns dann nur noch um die zusätzlichen Deps kümmern.
src/main/java/de/mediathekview/mlib/filmlisten/reader/OldFilmlistToRawFilmlistReader.java
Outdated
Show resolved
Hide resolved
@@ -9,7 +9,7 @@ | |||
|
|||
import java.io.IOException; | |||
|
|||
import static jakarta.ws.rs.core.HttpHeaders.CONTENT_LENGTH; | |||
import static javax.ws.rs.core.HttpHeaders.CONTENT_LENGTH; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
MServer verwendet die jakarta-Variante, keine Ahnung ob das im Zusammenspiel mit MLib problematisch werden könnte. Warum wieder zurück zur "alten" Variante?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dependency Version hat sich geändert und da sind die Pfade noch so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also wrote some findings to Discord.
|
||
@Mapper | ||
public interface RawFilmToFilmMapper { | ||
Logger LOG = LogManager.getLogger(RawFilmToFilmMapper.class); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use @slf4j when you already use Lombok instead of self definiton
Film rawFilmToFilm(RawFilm rawFilm); | ||
|
||
default List<GeoLocations> mapGeolocation(RawFilm rawFilm) { | ||
return GeoLocations.find(rawFilm.getGeo()).map(List::of).orElse(new ArrayList<>()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
return GeoLocations.find(rawFilm.getGeo()).stream().collect(Collectors.toList());
|
||
@AfterMapping | ||
default void complexMappings(RawFilm rawFilm, @MappingTarget Film film) { | ||
long groesse = mapSize(rawFilm); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could be final
SonarCloud Quality Gate failed. |
Please retry analysis of this Pull-Request directly on SonarCloud. |
In context of the Filmlistmerger I created a new, more performant, reader for the old Filmlist .