Skip to content

Commit

Permalink
removed unneeded classes. removed need to breakout upcoming recordings
Browse files Browse the repository at this point in the history
into individual json files
  • Loading branch information
Daniel Frey committed Oct 22, 2012
1 parent cf6173f commit de88307
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 190 deletions.
2 changes: 0 additions & 2 deletions src/org/mythtv/db/dvr/ProgramConstants.java
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
*/
public class ProgramConstants implements BaseColumns {

public enum ProgramType { RECORDED, UPCOMING, GUIDE, PREVIOUSLY_RECORDED };

public static final String TABLE_NAME_PROGRAM = "program";
public static final String TABLE_NAME_RECORDED = "recorded";
public static final String TABLE_NAME_UPCOMING = "upcoming";
Expand Down
46 changes: 0 additions & 46 deletions src/org/mythtv/service/dvr/UpcomingDownloadService.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,11 @@
import java.io.File;
import java.io.IOException;
import java.text.DecimalFormat;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.TimeZone;
import java.util.TreeMap;

import org.apache.commons.io.FileUtils;
import org.joda.time.DateTime;
import org.joda.time.DateTimeZone;
import org.mythtv.R;
import org.mythtv.service.MythtvService;
import org.mythtv.service.util.DateUtils;
import org.mythtv.services.api.ETagInfo;
import org.mythtv.services.api.dvr.Program;
import org.mythtv.services.api.dvr.ProgramList;
import org.mythtv.services.api.dvr.Programs;
import org.springframework.http.HttpStatus;
Expand Down Expand Up @@ -180,43 +171,6 @@ private void process( Programs programs ) throws JsonGenerationException, JsonMa

mMainApplication.getObjectMapper().writeValue( new File( upcomingDirectory, UPCOMING_FILE ), programs );

Map<DateTime, Programs> upcomingDates = new TreeMap<DateTime, Programs>();
for( Program program : programs.getPrograms() ) {
//Log.v( TAG, "download : upcoming program iteration" );

program.setStartTime( program.getStartTime().withZone( DateTimeZone.forID( TimeZone.getDefault().getID() ) ) );
program.setEndTime( program.getEndTime().withZone( DateTimeZone.forID( TimeZone.getDefault().getID() ) ) );

DateTime date = program.getStartTime().withTime( 0, 0, 0, 0 ).withZone( DateTimeZone.forID( TimeZone.getDefault().getID() ) );
if( upcomingDates.containsKey( date ) ) {
//Log.v( TAG, "download : adding program to EXISTING " + DateUtils.dateFormatter.print( date ) );

upcomingDates.get( date ).getPrograms().add( program );
} else {
//Log.v( TAG, "download : adding program to NEW " + DateUtils.dateFormatter.print( date ) );
Programs datePrograms = new Programs();

List<Program> dateProgramList = new ArrayList<Program>();
dateProgramList.add( program );
datePrograms.setPrograms( dateProgramList );

upcomingDates.put( date, datePrograms );
}

}

int count = 1;
for( DateTime date : upcomingDates.keySet() ) {
Programs upcomingPrograms = upcomingDates.get( date );

String key = DateUtils.dateFormatter.print( date );

mMainApplication.getObjectMapper().writeValue( new File( upcomingDirectory, key + UPCOMING_FILE_EXT ), upcomingPrograms );

double percentage = ( (float) count / (float) programs.getPrograms().size() ) * 100;
progressUpdate( percentage );
}

int programsAdded = mUpcomingProcessor.processPrograms( programs );
Log.v( TAG, "process : programsAdded=" + programsAdded );

Expand Down
142 changes: 0 additions & 142 deletions src/org/mythtv/service/dvr/cache/UpcomingLruMemoryCache.java

This file was deleted.

0 comments on commit de88307

Please sign in to comment.