package com.jonasgerdes.schauburgr.network.image;

import com.jonasgerdes.schauburgr.model.Movie;

/**
 * Created by jonas on 07.03.2017.
 */

public class SchauburgImageUrlCreator implements ImageUrlCreator {

    private String mBaseUrl;

    public SchauburgImageUrlCreator(String baseUrl) {
        mBaseUrl = baseUrl;
    }

    @Override
    public String getPosterImageUrl(Movie movie) {
        return mBaseUrl + "generated/" + movie.getResourceId() + ".jpg";
    }
}

@@ -44,16 +44,45 @@
 image;%0A%0A
+import android.util.Base64;%0A%0A
 import c
@@ -120,16 +120,16 @@
 .Movie;%0A
-
 %0A/**%0A * 
@@ -413,24 +413,378 @@
 ie movie) %7B%0A
+        //Encode title as Base64 and append it to url to prevent issue when same image is used for%0A        //different movie while still allowing image to be cached as long as used for same movie%0A        byte%5B%5D titleBytes = movie.getTitle().getBytes();%0A        String fingerprint = Base64.encodeToString(titleBytes, Base64.URL_SAFE %7C Base64.NO_PADDING);%0A
         retu
@@ -841,17 +841,34 @@
  + %22.jpg
-%22
+?f=%22 + fingerprint
 ;%0A    %7D%0A

Fix wrong posters beeing displayed