Skip to content

Commit

Permalink
minor refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Frey committed Sep 10, 2013
1 parent 616a481 commit c282b7f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 37 deletions.
8 changes: 4 additions & 4 deletions src/org/mythtv/client/ui/dvr/UpcomingPagerFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,12 @@
import java.util.List;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.mythtv.R;
import org.mythtv.client.ui.AbstractMythFragment;
import org.mythtv.client.ui.preferences.LocationProfile;
import org.mythtv.client.ui.util.MenuHelper;
import org.mythtv.client.ui.util.MenuItemRefreshAnimated;
import org.mythtv.db.dvr.DvrEndpoint;
import org.mythtv.db.http.EtagDaoHelper;
import org.mythtv.service.dvr.UpcomingDownloadService;
import org.mythtv.service.util.DateUtils;
Expand Down Expand Up @@ -105,10 +105,10 @@ public void onActivityCreated( Bundle savedInstanceState ) {

mLocationProfile = mLocationProfileDaoHelper.findConnectedProfile( getActivity() );

DateTime etag = mEtagDaoHelper.findDateByEndpointAndDataId( getActivity(), mLocationProfile, DvrEndpoint.GET_UPCOMING_LIST.name(), "" );
DateTime etag = mEtagDaoHelper.findDateByEndpointAndDataId( getActivity(), mLocationProfile, "GetUpcomingList", "" );
if( null != etag ) {

DateTime now = DateUtils.convertUtc( new DateTime( System.currentTimeMillis() ) );
DateTime now = new DateTime( DateTimeZone.UTC );
if( now.getMillis() - etag.getMillis() > ( 2 * 3600000 ) ) {
loadData();
}
Expand All @@ -127,7 +127,7 @@ public void onStart() {
Log.v( TAG, "onStart : enter" );
super.onStart();

IntentFilter upcomingDownloadFilter = new IntentFilter();
IntentFilter upcomingDownloadFilter = new IntentFilter( UpcomingDownloadService.ACTION_DOWNLOAD );
upcomingDownloadFilter.addAction( UpcomingDownloadService.ACTION_PROGRESS );
upcomingDownloadFilter.addAction( UpcomingDownloadService.ACTION_COMPLETE );
getActivity().registerReceiver( upcomingDownloadReceiver, upcomingDownloadFilter );
Expand Down
16 changes: 0 additions & 16 deletions src/org/mythtv/service/dvr/v26/UpcomingHelperV26.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
import org.mythtv.db.dvr.ProgramConstants;
import org.mythtv.db.dvr.RecordingConstants;
import org.mythtv.db.http.model.EtagInfoDelegate;
import org.mythtv.service.channel.v26.ChannelHelperV26;
import org.mythtv.service.util.DateUtils;
import org.mythtv.services.api.ApiVersion;
import org.mythtv.services.api.connect.MythAccessFactory;
Expand Down Expand Up @@ -163,8 +162,6 @@ private int load( final Context context, final LocationProfile locationProfile,

boolean inError;

List<Integer> channelsChecked = new ArrayList<Integer>();

for( Program program : programs ) {

if( null == program.getStartTime() || null == program.getEndTime() ) {
Expand All @@ -185,19 +182,6 @@ private int load( final Context context, final LocationProfile locationProfile,
ProgramHelperV26.getInstance().processProgram( context, locationProfile, ProgramConstants.CONTENT_URI_GUIDE, ProgramConstants.TABLE_NAME_GUIDE, ops, program, lastModified, startTime, count );
count++;

if( null != program.getChannelInfo() ) {

if( !channelsChecked.contains( program.getChannelInfo().getChannelId() ) ) {

ChannelHelperV26.getInstance().processChannel( context, locationProfile, ops, program.getChannelInfo(), lastModified, count );
count++;

channelsChecked.add( program.getChannelInfo().getChannelId() );

}

}

if( !inError && null != program.getRecording() ) {

if( program.getRecording().getRecordId() > 0 ) {
Expand Down
17 changes: 0 additions & 17 deletions src/org/mythtv/service/dvr/v27/UpcomingHelperV27.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
package org.mythtv.service.dvr.v27;

import java.util.ArrayList;
import java.util.List;

import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
Expand All @@ -13,7 +12,6 @@
import org.mythtv.db.dvr.ProgramConstants;
import org.mythtv.db.dvr.RecordingConstants;
import org.mythtv.db.http.model.EtagInfoDelegate;
import org.mythtv.service.channel.v27.ChannelHelperV27;
import org.mythtv.services.api.ApiVersion;
import org.mythtv.services.api.connect.MythAccessFactory;
import org.mythtv.services.api.v027.MythServicesTemplate;
Expand Down Expand Up @@ -159,8 +157,6 @@ private int load( final Context context, final LocationProfile locationProfile,

boolean inError;

List<Integer> channelsChecked = new ArrayList<Integer>();

for( Program program : programs ) {
Log.d( TAG, "load : count=" + count );

Expand All @@ -182,19 +178,6 @@ private int load( final Context context, final LocationProfile locationProfile,
ProgramHelperV27.getInstance().processProgram( context, locationProfile, ProgramConstants.CONTENT_URI_GUIDE, ProgramConstants.TABLE_NAME_GUIDE, ops, program, lastModified, startTime, count );
count++;

if( null != program.getChannel() ) {

if( !channelsChecked.contains( program.getChannel().getChanId() ) ) {

ChannelHelperV27.getInstance().processChannel( context, locationProfile, ops, program.getChannel(), lastModified, count );
count++;

channelsChecked.add( program.getChannel().getChanId() );

}

}

if( !inError && null != program.getRecording() ) {

if( program.getRecording().getRecordId() > 0 ) {
Expand Down

0 comments on commit c282b7f

Please sign in to comment.