Add documentation and fix SonarCloud issue

This commit is contained in:
Stypox 2023-05-02 21:06:12 +02:00
parent 8d463b9577
commit bf908f0b7d
No known key found for this signature in database
GPG key ID: 4BDF1B40A49FDD23
5 changed files with 43 additions and 21 deletions

View file

@ -70,7 +70,9 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
@Ignore
public PlaylistRemoteEntity(final PlaylistInfo info) {
this(info.getServiceId(), info.getName(), info.getUrl(),
ImageStrategy.choosePreferredImage(info.getThumbnails()),
// use uploader avatar when no thumbnail is available
ImageStrategy.choosePreferredImage(info.getThumbnails().isEmpty()
? info.getUploaderAvatars() : info.getThumbnails()),
info.getUploaderName(), info.getStreamCount());
}
@ -84,6 +86,8 @@ public class PlaylistRemoteEntity implements PlaylistLocalItem {
&& getStreamCount() == info.getStreamCount()
&& TextUtils.equals(getName(), info.getName())
&& TextUtils.equals(getUrl(), info.getUrl())
// we want to update the local playlist data even when either the remote thumbnail
// URL changes, or the preferred image quality setting is changed by the user
&& TextUtils.equals(getThumbnailUrl(),
ImageStrategy.choosePreferredImage(info.getThumbnails()))
&& TextUtils.equals(getUploader(), info.getUploaderName());