<commit_before>
package com.battlelancer.seriesguide;

import com.battlelancer.seriesguide.provider.SeriesContract.Shows;
import com.battlelancer.seriesguide.ui.BaseActivity;
import com.battlelancer.seriesguide.util.AnalyticsUtils;
import com.battlelancer.thetvdbapi.ImageCache;
import com.battlelancer.thetvdbapi.Series;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.ActionBar;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;

public class ShowInfo extends BaseActivity {
    public static final String IMDB_TITLE_URL = "http://imdb.com/title/";

    private ImageCache imageCache;

    private String seriesid;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.show_info);

        final ActionBar actionBar = getSupportActionBar();
        actionBar.setTitle(getString(R.string.context_showinfo));
        actionBar.setDisplayShowTitleEnabled(true);

        imageCache = ((SeriesGuideApplication) getApplication()).getImageCache();

        Bundle extras = getIntent().getExtras();
        seriesid = extras.getString(Shows._ID);

        fillData();
    }

    @Override
    protected void onStart() {
        super.onStart();
        AnalyticsUtils.getInstance(this).trackPageView("/ShowInfo");
    }

    private void fillData() {
        TextView seriesname = (TextView) findViewById(R.id.title);
        TextView overview = (TextView) findViewById(R.id.TextViewShowInfoOverview);
        TextView actors = (TextView) findViewById(R.id.TextViewShowInfoActors);
        TextView airstime = (TextView) findViewById(R.id.TextViewShowInfoAirtime);
        TextView contentrating = (TextView) findViewById(R.id.TextViewShowInfoContentRating);
        TextView firstaired = (TextView) findViewById(R.id.TextViewShowInfoFirstAirdate);
        TextView genres = (TextView) findViewById(R.id.TextViewShowInfoGenres);
        TextView network = (TextView) findViewById(R.id.TextViewShowInfoNetwork);
        TextView rating = (TextView) findViewById(R.id.value);
        TextView runtime = (TextView) findViewById(R.id.TextViewShowInfoRuntime);
        TextView status = (TextView) findViewById(R.id.TextViewShowInfoStatus);
        ImageView showart = (ImageView) findViewById(R.id.ImageViewShowInfoPoster);
        View showInIMDB = (View) findViewById(R.id.buttonShowInfoIMDB);

        final Series show = SeriesDatabase.getShow(this, seriesid);
        if (show == null) {
            finish();
        }

        // Name
        seriesname.setText(show.getSeriesName());

        // Overview
        if (show.getOverview().length() == 0) {
            overview.setText(getString(R.string.show_pleaseupdate));
        } else {
            overview.setText(show.getOverview());
        }

        // Airtimes
        if (show.getAirsDayOfWeek().length() == 0 && show.getAirsTime() == -1) {
            airstime.setText(getString(R.string.show_noairtime));
        } else {
            String[] values = SeriesGuideData.parseMillisecondsToTime(show.getAirsTime(),
                    show.getAirsDayOfWeek(), getApplicationContext());
            airstime.setText(getString(R.string.show_airs) + " " + values[1] + " " + values[0]);
        }

        // Network
        if (show.getNetwork().length() == 0) {
            network.setText("");
        } else {
            network.setText(getString(R.string.show_network) + " " + show.getNetwork());
        }

        // Running state
        if (show.getStatus() == 1) {
            status.setTextColor(Color.GREEN);
            status.setText(getString(R.string.show_isalive));
        } else if (show.getStatus() == 0) {
            status.setTextColor(Color.GRAY);
            status.setText(getString(R.string.show_isnotalive));
        }

        // Others
        actors.setText(getString(R.string.show_actors) + " "
                + SeriesGuideData.splitAndKitTVDBStrings(show.getActors()));
        contentrating.setText(getString(R.string.show_contentrating) + " "
                + show.getContentRating());
        firstaired.setText(getString(R.string.show_firstaired)
                + " "
                + SeriesGuideData.parseDateToLocal(show.getFirstAired(), show.getAirsTime(),<commit_msg>Show 'no air times available' message if either air day or time are missing as we cannot caculate the local date and time then.<commit_after>
package com.battlelancer.seriesguide;

import com.battlelancer.seriesguide.provider.SeriesContract.Shows;
import com.battlelancer.seriesguide.ui.BaseActivity;
import com.battlelancer.seriesguide.util.AnalyticsUtils;
import com.battlelancer.thetvdbapi.ImageCache;
import com.battlelancer.thetvdbapi.Series;

import android.content.ActivityNotFoundException;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.Color;
import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.ActionBar;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.ImageView;
import android.widget.RatingBar;
import android.widget.TextView;
import android.widget.Toast;

public class ShowInfo extends BaseActivity {
    public static final String IMDB_TITLE_URL = "http://imdb.com/title/";

    private ImageCache imageCache;

    private String seriesid;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.show_info);

        final ActionBar actionBar = getSupportActionBar();
        actionBar.setTitle(getString(R.string.context_showinfo));
        actionBar.setDisplayShowTitleEnabled(true);

        imageCache = ((SeriesGuideApplication) getApplication()).getImageCache();

        Bundle extras = getIntent().getExtras();
        seriesid = extras.getString(Shows._ID);

        fillData();
    }

    @Override
    protected void onStart() {
        super.onStart();
        AnalyticsUtils.getInstance(this).trackPageView("/ShowInfo");
    }

    private void fillData() {
        TextView seriesname = (TextView) findViewById(R.id.title);
        TextView overview = (TextView) findViewById(R.id.TextViewShowInfoOverview);
        TextView actors = (TextView) findViewById(R.id.TextViewShowInfoActors);
        TextView airstime = (TextView) findViewById(R.id.TextViewShowInfoAirtime);
        TextView contentrating = (TextView) findViewById(R.id.TextViewShowInfoContentRating);
        TextView firstaired = (TextView) findViewById(R.id.TextViewShowInfoFirstAirdate);
        TextView genres = (TextView) findViewById(R.id.TextViewShowInfoGenres);
        TextView network = (TextView) findViewById(R.id.TextViewShowInfoNetwork);
        TextView rating = (TextView) findViewById(R.id.value);
        TextView runtime = (TextView) findViewById(R.id.TextViewShowInfoRuntime);
        TextView status = (TextView) findViewById(R.id.TextViewShowInfoStatus);
        ImageView showart = (ImageView) findViewById(R.id.ImageViewShowInfoPoster);
        View showInIMDB = (View) findViewById(R.id.buttonShowInfoIMDB);

        final Series show = SeriesDatabase.getShow(this, seriesid);
        if (show == null) {
            finish();
        }

        // Name
        seriesname.setText(show.getSeriesName());

        // Overview
        if (show.getOverview().length() == 0) {
            overview.setText(getString(R.string.show_pleaseupdate));
        } else {
            overview.setText(show.getOverview());
        }

        // Airtimes
        if (show.getAirsDayOfWeek().length() == 0 || show.getAirsTime() == -1) {
            airstime.setText(getString(R.string.show_noairtime));
        } else {
            String[] values = SeriesGuideData.parseMillisecondsToTime(show.getAirsTime(),
                    show.getAirsDayOfWeek(), getApplicationContext());
            airstime.setText(getString(R.string.show_airs) + " " + values[1] + " " + values[0]);
        }

        // Network
        if (show.getNetwork().length() == 0) {
            network.setText("");
        } else {
            network.setText(getString(R.string.show_network) + " " + show.getNetwork());
        }

        // Running state
        if (show.getStatus() == 1) {
            status.setTextColor(Color.GREEN);
            status.setText(getString(R.string.show_isalive));
        } else if (show.getStatus() == 0) {
            status.setTextColor(Color.GRAY);
            status.setText(getString(R.string.show_isnotalive));
        }

        // Others
        actors.setText(getString(R.string.show_actors) + " "
                + SeriesGuideData.splitAndKitTVDBStrings(show.getActors()));
        contentrating.setText(getString(R.string.show_contentrating) + " "
                + show.getContentRating());
        firstaired.setText(getString(R.string.show_firstaired)
                + " "
                + SeriesGuideData.parseDateToLocal(show.getFirstAired(), show.getAirsTime(),
{'fraction_non_alphanumeric': 0.11454741379310344, 'fraction_numerical': 0.001939655172413793, 'mean_word_length': 3.072400175515577, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4227404', 'n_tokens_mistral': 2656, 'n_tokens_neox': 2499, 'n_words': 427}