@@ -1193,7 +1193,8 @@ int main(int argc, char *argv[])
11931193 else if (cmdline.toBool (" rebuild" ))
11941194 result = RebuildSeekTable (chanid, starttime, -1 );
11951195 else
1196- result = FlagCommercials (chanid, starttime, -1 , " " );
1196+ result = FlagCommercials (chanid, starttime, -1 ,
1197+ cmdline.toString (" outputfile" ));
11971198 }
11981199 else if (cmdline.toBool (" jobid" ))
11991200 {
@@ -1243,22 +1244,36 @@ int main(int argc, char *argv[])
12431244 }
12441245 else if (cmdline.toBool (" file" ))
12451246 {
1246- // TODO: add back handling of recording defined by the basename
1247- if (cmdline.toBool (" rebuild" ))
1247+ if (cmdline.toBool (" skipdb" ))
12481248 {
1249- cerr << " You can no longer use --file with --rebuild. Please "
1250- " use --chanid and " << endl
1251- << " --starttime" << endl;
1252- return GENERIC_EXIT_INVALID_CMDLINE;
1253- }
1254-
1255- QString outputfile = cmdline.toString (" outputfile" );
1256- if (outputfile.isEmpty () && cmdline.toBool (" skipdb" ))
1257- outputfile = " -" ;
1249+ if (cmdline.toBool (" rebuild" ))
1250+ {
1251+ cerr << " The --rebuild parameter builds the seektable for "
1252+ " internal MythTV use only. It cannot be used in "
1253+ " combination with --skipdb." << endl;
1254+ return GENERIC_EXIT_INVALID_CMDLINE;
1255+ }
12581256
1259- // perform commercial flagging on file outside the database
1260- FlagCommercials (cmdline.toString (" file" ), -1 , outputfile,
1261- !cmdline.toBool (" skipdb" ));
1257+ // perform commercial flagging on file outside the database
1258+ FlagCommercials (cmdline.toString (" file" ), -1 ,
1259+ cmdline.toString (" outputfile" ),
1260+ !cmdline.toBool (" skipdb" ));
1261+ }
1262+ else
1263+ {
1264+ ProgramInfo pginfo (cmdline.toString (" file" ));
1265+ // pass chanid and starttime
1266+ // inefficient, but it lets the other function
1267+ // handle sanity checking
1268+ if (cmdline.toBool (" rebuild" ))
1269+ result = RebuildSeekTable (pginfo.GetChanID (),
1270+ pginfo.GetRecordingStartTime (),
1271+ -1 );
1272+ else
1273+ result = FlagCommercials (pginfo.GetChanID (),
1274+ pginfo.GetRecordingStartTime (),
1275+ -1 , cmdline.toString (" outputfile" ));
1276+ }
12621277 }
12631278 else if (cmdline.toBool (" queue" ))
12641279 {
0 commit comments