Skip to content

Commit

Permalink
issue #148
Browse files Browse the repository at this point in the history
I can only verify this still works against my single backend.
@billmeek, you're up :-)
  • Loading branch information
Daniel Frey committed Sep 14, 2013
1 parent 609e482 commit d8a1448
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion src/org/mythtv/client/ui/dvr/EpisodeFragment.java
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ private void startCreateStreamService() {

Intent intent = new Intent( LiveStreamService.ACTION_CREATE );
intent.putExtra( LiveStreamService.KEY_CHANNEL_ID, program.getChannelInfo().getChannelId() );
intent.putExtra( LiveStreamService.KEY_START_TIMESTAMP, program.getRecording().getStartTimestamp().getMillis() );
intent.putExtra( LiveStreamService.KEY_START_TIMESTAMP, program.getStartTime().getMillis() );
getActivity().startService( intent );

runningIntent = intent;
Expand Down
16 changes: 8 additions & 8 deletions src/org/mythtv/service/content/v26/LiveStreamHelperV26.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public boolean create( final Context context, final LocationProfile locationProf
if( wrapper.getStatusCode().equals( HttpStatus.OK ) ) {
LiveStreamInfo liveStreamInfo = wrapper.getBody().getLiveStreamInfo();

save( context, locationProfile, liveStreamInfo, program );
save( context, locationProfile, liveStreamInfo, channelId, startTime );

Log.v( TAG, "create : exit" );
return true;
Expand All @@ -122,7 +122,7 @@ public boolean create( final Context context, final LocationProfile locationProf
return false;
}

public boolean update( final Context context, final LocationProfile locationProfile, final Integer channelId, final DateTime startTime ) {
public boolean update( final Context context, final LocationProfile locationProfile, final int channelId, final DateTime startTime ) {
Log.v( TAG, "update : enter" );

if( !NetworkHelper.getInstance().isMasterBackendConnected( context, locationProfile ) ) {
Expand All @@ -144,7 +144,7 @@ public boolean update( final Context context, final LocationProfile locationProf
LiveStreamInfo updated = wrapper.getBody().getLiveStreamInfo();

if( !"Unknown status value".equalsIgnoreCase( updated.getStatusStr() ) ) {
save( context, locationProfile, updated, program );
save( context, locationProfile, updated, channelId, startTime );
} else {
deleteLiveStream( context, locationProfile, channelId, startTime );
}
Expand Down Expand Up @@ -294,15 +294,15 @@ public boolean deleteLiveStream( final Context context, final LocationProfile lo

// internal helpers

private boolean save( final Context context, final LocationProfile locationProfile, LiveStreamInfo liveStreamInfo, final Program program ) {
private boolean save( final Context context, final LocationProfile locationProfile, LiveStreamInfo liveStreamInfo, int channelId, DateTime startTime ) {
Log.d( TAG, "save : enter" );

if( null == context )
throw new RuntimeException( "LiveStreamHelperV27 is not initialized" );

boolean saved = false;

ContentValues values = convertLiveStreamInfoToContentValues( locationProfile, liveStreamInfo, program );
ContentValues values = convertLiveStreamInfoToContentValues( locationProfile, liveStreamInfo, channelId, startTime );

String[] projection = new String[] { LiveStreamConstants.TABLE_NAME + "_" + LiveStreamConstants._ID };
String selection = LiveStreamConstants.FIELD_ID + " = ?";
Expand Down Expand Up @@ -472,7 +472,7 @@ private LiveStreamInfo convertCursorToLiveStreamInfo( Cursor cursor ) {
return liveStreamInfo;
}

private ContentValues convertLiveStreamInfoToContentValues( final LocationProfile locationProfile, final LiveStreamInfo liveStreamInfo, final Program program ) {
private ContentValues convertLiveStreamInfoToContentValues( final LocationProfile locationProfile, final LiveStreamInfo liveStreamInfo, final int channelId, final DateTime startTime ) {
// Log.v( TAG, "convertLiveStreamToContentValues : enter" );

ContentValues values = new ContentValues();
Expand All @@ -499,8 +499,8 @@ private ContentValues convertLiveStreamInfoToContentValues( final LocationProfil
values.put( LiveStreamConstants.FIELD_SOURCE_WIDTH, liveStreamInfo.getSourceWidth() );
values.put( LiveStreamConstants.FIELD_SOURCE_HEIGHT, liveStreamInfo.getSourceHeight() );
values.put( LiveStreamConstants.FIELD_AUDIO_ONLY_BITRATE, liveStreamInfo.getAudioOnlyBitrate() );
values.put( LiveStreamConstants.FIELD_CHAN_ID, program.getChannelInfo().getChannelId() );
values.put( LiveStreamConstants.FIELD_START_TIME, program.getStartTime().getMillis() );
values.put( LiveStreamConstants.FIELD_CHAN_ID, channelId );
values.put( LiveStreamConstants.FIELD_START_TIME, startTime.getMillis() );
values.put( LiveStreamConstants.FIELD_MASTER_HOSTNAME, locationProfile.getHostname() );

// Log.v( TAG, "convertLiveStreamToContentValues : exit" );
Expand Down
14 changes: 7 additions & 7 deletions src/org/mythtv/service/content/v27/LiveStreamHelperV27.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public boolean create( final Context context, final LocationProfile locationProf
if( wrapper.getStatusCode().equals( HttpStatus.OK ) ) {
LiveStreamInfo liveStreamInfo = wrapper.getBody();

save( context, locationProfile, liveStreamInfo, program );
save( context, locationProfile, liveStreamInfo, channelId, startTime );

Log.v( TAG, "create : exit" );
return true;
Expand Down Expand Up @@ -144,7 +144,7 @@ public boolean update( final Context context, final LocationProfile locationProf
LiveStreamInfo updated = wrapper.getBody();

if( !"Unknown status value".equalsIgnoreCase( updated.getStatusStr() ) ) {
save( context, locationProfile, updated, program );
save( context, locationProfile, updated, channelId, startTime );
} else {
deleteLiveStream( context, locationProfile, channelId, startTime );
}
Expand Down Expand Up @@ -294,15 +294,15 @@ public boolean deleteLiveStream( final Context context, final LocationProfile lo

// internal helpers

private boolean save( final Context context, final LocationProfile locationProfile, LiveStreamInfo liveStreamInfo, final Program program ) {
private boolean save( final Context context, final LocationProfile locationProfile, LiveStreamInfo liveStreamInfo, int channelId, DateTime startTime ) {
Log.d( TAG, "save : enter" );

if( null == context )
throw new RuntimeException( "LiveStreamHelperV27 is not initialized" );

boolean saved = false;

ContentValues values = convertLiveStreamInfoToContentValues( locationProfile, liveStreamInfo, program );
ContentValues values = convertLiveStreamInfoToContentValues( locationProfile, liveStreamInfo, channelId, startTime );

String[] projection = new String[] { LiveStreamConstants.TABLE_NAME + "_" + LiveStreamConstants._ID };
String selection = LiveStreamConstants.FIELD_ID + " = ?";
Expand Down Expand Up @@ -472,7 +472,7 @@ private LiveStreamInfo convertCursorToLiveStreamInfo( Cursor cursor ) {
return liveStreamInfo;
}

private ContentValues convertLiveStreamInfoToContentValues( final LocationProfile locationProfile, final LiveStreamInfo liveStreamInfo, final Program program ) {
private ContentValues convertLiveStreamInfoToContentValues( final LocationProfile locationProfile, final LiveStreamInfo liveStreamInfo, final int channelId, final DateTime startTime ) {
// Log.v( TAG, "convertLiveStreamToContentValues : enter" );

ContentValues values = new ContentValues();
Expand All @@ -499,8 +499,8 @@ private ContentValues convertLiveStreamInfoToContentValues( final LocationProfil
values.put( LiveStreamConstants.FIELD_SOURCE_WIDTH, liveStreamInfo.getSourceWidth() );
values.put( LiveStreamConstants.FIELD_SOURCE_HEIGHT, liveStreamInfo.getSourceHeight() );
values.put( LiveStreamConstants.FIELD_AUDIO_ONLY_BITRATE, liveStreamInfo.getAudioOnlyBitrate() );
values.put( LiveStreamConstants.FIELD_CHAN_ID, program.getChannel().getChanId() );
values.put( LiveStreamConstants.FIELD_START_TIME, program.getStartTime().getMillis() );
values.put( LiveStreamConstants.FIELD_CHAN_ID, channelId );
values.put( LiveStreamConstants.FIELD_START_TIME, startTime.getMillis() );
values.put( LiveStreamConstants.FIELD_MASTER_HOSTNAME, locationProfile.getHostname() );

// Log.v( TAG, "convertLiveStreamToContentValues : exit" );
Expand Down

0 comments on commit d8a1448

Please sign in to comment.