40
40
public class Channels extends VirtualFolder implements FileListener {
41
41
42
42
// Version string
43
- public static final String VERSION ="2.22 " ;
43
+ public static final String VERSION ="2.25 " ;
44
44
public static final String ZIP_VER ="211" ;
45
45
46
46
// Constants for RTMP string constructions
@@ -1293,6 +1293,7 @@ private void parseMonitorFile() {
1293
1293
StringBuilder sb =null ;
1294
1294
String templ =null ;
1295
1295
String search =null ;
1296
+ boolean try_search = false ;
1296
1297
while ((str = in .readLine ()) != null ) {
1297
1298
if (ChannelUtil .empty (str ))
1298
1299
continue ;
@@ -1316,13 +1317,15 @@ private void parseMonitorFile() {
1316
1317
ChannelMonitor m =new ChannelMonitor (mf ,entries ,name );
1317
1318
m .setTemplate (templ );
1318
1319
m .setSearch (search );
1320
+ m .setTrySearch (try_search );
1319
1321
monMgr .add (m );
1320
1322
// Clear all vars
1321
1323
name =null ;
1322
1324
templ =null ;
1323
1325
entries =null ;
1324
1326
owner =null ;
1325
1327
search =null ;
1328
+ try_search = false ;
1326
1329
}
1327
1330
}
1328
1331
}
@@ -1354,6 +1357,10 @@ private void parseMonitorFile() {
1354
1357
sb =new StringBuilder ();
1355
1358
continue ;
1356
1359
}
1360
+ if (str .startsWith ("try_search=" )) {
1361
+ try_search = str .substring (11 ).equalsIgnoreCase ("true" );
1362
+ continue ;
1363
+ }
1357
1364
if (str .startsWith ("name=" )) {
1358
1365
if (ChannelUtil .empty (name )) { // only pick 1st name, just to simplify parsing
1359
1366
name =str .substring (5 );
@@ -1409,6 +1416,7 @@ public static void monitor(DLNAResource res,ChannelFolder cf,
1409
1416
String nameProp =cf .getProp ("monitor_name" );
1410
1417
String washedName =monNameWash (res .getName (),templ ,searched ,nameProp );
1411
1418
StringBuffer sb =new StringBuffer ();
1419
+ boolean try_search = cf .getProperty ("monitor_try_search" );
1412
1420
if (newFile ) {
1413
1421
sb .append ("######\n " );
1414
1422
sb .append ("## NOTE!!!!!\n " );
@@ -1423,6 +1431,8 @@ public static void monitor(DLNAResource res,ChannelFolder cf,
1423
1431
ChannelUtil .appendVarLine (sb , "templ" , templ );
1424
1432
if (!ChannelUtil .empty (searched ))
1425
1433
ChannelUtil .appendVarLine (sb , "search" , searched );
1434
+ if (try_search )
1435
+ ChannelUtil .appendVarLine (sb , "try_search" , "true" );
1426
1436
ArrayList <String > entries =new ArrayList <String >();
1427
1437
for (DLNAResource r : res .getChildren ()) {
1428
1438
if (ChannelUtil .filterInternals (r ))
@@ -1440,6 +1450,7 @@ public static void monitor(DLNAResource res,ChannelFolder cf,
1440
1450
String str =lines [i ].trim ();
1441
1451
if (str .startsWith ("monitor" )||
1442
1452
str .startsWith ("owner" )||
1453
+ str .startsWith ("try_search" ) ||
1443
1454
str .startsWith ("templ" )) {
1444
1455
// skip the start lines
1445
1456
continue ;
@@ -1453,6 +1464,7 @@ public static void monitor(DLNAResource res,ChannelFolder cf,
1453
1464
ChannelMonitor m =new ChannelMonitor (mf ,entries ,washedName );
1454
1465
m .setTemplate (templ );
1455
1466
m .setSearch (searched );
1467
+ m .setTrySearch (try_search );
1456
1468
inst .monMgr .add (m );
1457
1469
continue ;
1458
1470
}
0 commit comments