Switch to unified view

a/src/mediaserver/contentdirectory.cxx b/src/mediaserver/contentdirectory.cxx
...
...
303
    // Root directory: we do this ourselves
303
    // Root directory: we do this ourselves
304
    totalmatches = readroot(in_StartingIndex, in_RequestedCount, entries);
304
    totalmatches = readroot(in_StartingIndex, in_RequestedCount, entries);
305
    } else {
305
    } else {
306
    // Pass off request to appropriate app, defined by 1st elt in id
306
    // Pass off request to appropriate app, defined by 1st elt in id
307
    string app = appForId(in_ObjectID);
307
    string app = appForId(in_ObjectID);
308
  LOGDEB("ContentDirectory::actBrowse: app: [" << app << "]\n");
309
310
    CDPlugin *plg = m->pluginForApp(app);
308
    CDPlugin *plg = m->pluginForApp(app);
311
    if (plg) {
309
    if (plg) {
312
        totalmatches = plg->browse(in_ObjectID, in_StartingIndex,
310
        totalmatches = plg->browse(in_ObjectID, in_StartingIndex,
313
                                       in_RequestedCount, entries,
311
                                       in_RequestedCount, entries,
314
                                       sortcrits, bf);
312
                                       sortcrits, bf);
315
    } else {
313
    } else {
316
        LOGERR("ContentDirectory::Browse: unknown app: [" << app << "]\n");
314
        LOGERR("ContentDirectory::Browse: unknown app: [" << app << "]\n");
315
            return UPNP_E_INVALID_PARAM;
317
    }
316
    }
318
    }
317
    }
319
320
318
321
    // Process and send out result
319
    // Process and send out result
322
    out_NumberReturned = ulltodecstr(entries.size());
320
    out_NumberReturned = ulltodecstr(entries.size());
323
    out_TotalMatches = ulltodecstr(totalmatches);
321
    out_TotalMatches = ulltodecstr(totalmatches);
324
    out_UpdateID = m->updateID;
322
    out_UpdateID = m->updateID;
325
    out_Result = headDIDL();
323
    out_Result = headDIDL();
326
    for (unsigned int i = 0; i < entries.size(); i++) {
324
    for (unsigned int i = 0; i < entries.size(); i++) {
327
    out_Result += entries[i].didl();
325
    out_Result += entries[i].didl();
328
    } 
326
    } 
329
    out_Result += tailDIDL();
327
    out_Result += tailDIDL();
328
    LOGDEB1("ContentDirectory::Browse: didl: " << out_Result << endl);
330
    
329
    
331
    data.addarg("Result", out_Result);
330
    data.addarg("Result", out_Result);
332
    LOGDEB1("ContentDirectory::actBrowse: result [" << out_Result << "]\n");
331
    LOGDEB1("ContentDirectory::actBrowse: result [" << out_Result << "]\n");
333
    data.addarg("NumberReturned", out_NumberReturned);
332
    data.addarg("NumberReturned", out_NumberReturned);
334
    data.addarg("TotalMatches", out_TotalMatches);
333
    data.addarg("TotalMatches", out_TotalMatches);
...
...
403
        in_ContainerID = last_objid;
402
        in_ContainerID = last_objid;
404
    }
403
    }
405
404
406
    // Pass off request to appropriate app, defined by 1st elt in id
405
    // Pass off request to appropriate app, defined by 1st elt in id
407
    string app = appForId(in_ContainerID);
406
    string app = appForId(in_ContainerID);
408
    LOGDEB("ContentDirectory::actSearch: app: [" << app << "]\n");
409
410
    CDPlugin *plg = m->pluginForApp(app);
407
    CDPlugin *plg = m->pluginForApp(app);
411
    if (plg) {
408
    if (plg) {
412
        totalmatches = plg->search(in_ContainerID, in_StartingIndex,
409
        totalmatches = plg->search(in_ContainerID, in_StartingIndex,
413
                                   in_RequestedCount, in_SearchCriteria,
410
                                   in_RequestedCount, in_SearchCriteria,
414
                                   entries, sortcrits);
411
                                   entries, sortcrits);
415
    } else {
412
    } else {
416
        LOGERR("ContentDirectory::Browse: unknown app: [" << app << "]\n");
413
        LOGERR("ContentDirectory::Search: unknown app: [" << app << "]\n");
414
        return UPNP_E_INVALID_PARAM;
417
    }
415
    }
418
416
419
    // Process and send out result
417
    // Process and send out result
420
    out_NumberReturned = ulltodecstr(entries.size());
418
    out_NumberReturned = ulltodecstr(entries.size());
421
    out_TotalMatches = ulltodecstr(totalmatches);
419
    out_TotalMatches = ulltodecstr(totalmatches);