Ticket #3579: findfirstnodeimage.diff

File findfirstnodeimage.diff, 1.7 KB (added by robert.mcnamara@…, 15 years ago)

update and improve for trunk

  • mythplugins/mythvideo/mythvideo/videodlg.cpp

     
    23312331                fList = vidDir.entryList();
    23322332            }
    23332333
     2334            // Take the Coverfile for the first valid node in the dir, if it exists.
     2335            if (icon_file.isEmpty())
     2336            {
     2337                int list_count = node->childCount();
     2338                if (list_count > 0)
     2339                {
     2340                    for (int i = 0; i < list_count; i++)
     2341                    {
     2342                        MythGenericTree *subnode = node->getChildAt(i);
     2343                        if (subnode)
     2344                        {
     2345                            Metadata *metadata = GetMetadataPtrFromNode(subnode);
     2346                            if (metadata)
     2347                            {
     2348                                if (!metadata->GetHost().isEmpty() && !metadata->GetCoverFile().startsWith("/"))
     2349                                {
     2350                                    icon_file = GenRemoteFileURL("Coverart", metadata->GetHost(), metadata->GetCoverFile());
     2351                                    break;
     2352                                }
     2353                                else
     2354                                {
     2355                                    icon_file = metadata->GetCoverFile();
     2356                                    break;
     2357                                }
     2358                            }
     2359                        }
     2360                    }
     2361                }
     2362            }
     2363
    23342364            if (!fList.isEmpty())
    23352365            {
    23362366                if (host.isEmpty())