package com.rashwan.reactive_popular_movies.service;

import android.app.Application;

import com.rashwan.reactive_popular_movies.common.utilities.Exceptions;
import com.rashwan.reactive_popular_movies.common.utilities.Utilities;
import com.rashwan.reactive_popular_movies.data.remote.OMDBApi;
import com.rashwan.reactive_popular_movies.data.model.MovieDetails;

import retrofit2.Retrofit;
import rx.Observable;

/**
 * Created by rashwan on 4/12/17.
 */

public class OMDBServiceImp implements OMDBService {
    private Retrofit retrofit;
    private Application application;

    public OMDBServiceImp(Retrofit retrofit, Application application) {
        this.retrofit = retrofit;
        this.application = application;
    }

    @Override
    public Observable<MovieDetails> getMovieDetails(String tmdbId) {
        if (!Utilities.isNetworkAvailable(application)){
            return Observable.error(new Exceptions.NoInternetException("No internet connection"));
        }
        return retrofit.create(OMDBApi.class).getMovieDetails(tmdbId);
    }
}

@@ -227,72 +227,8 @@
 es;%0A
-import com.rashwan.reactive_popular_movies.data.remote.OMDBApi;%0A
 impo
@@ -909,16 +909,18 @@
       %7D%0A
+//
         
@@ -982,16 +982,51 @@
 mdbId);%0A
+        return Observable.empty();%0A
     %7D%0A%7D%0A

stop requests temporarily for OMDB API as it gone private