Repository: xbmc/xbmc
File: xbmc/video/tags/VideoTagLoaderFFmpeg.cpp (C++)

Code before:
      const size_t size = stream->attached_pic.size;
      if (art)
        art->emplace_back(stream->attached_pic.data, size, mimeTag->value, type);
      else
        tag.m_coverArt.emplace_back(size, mimeTag->value, type);
    }
  }

  if (m_metadata_stream != -1)
  {
    CNfoFile nfo;
    auto* data = m_fctx->streams[m_metadata_stream]->codecpar->extradata;
    const char* content = reinterpret_cast<const char*>(data);
    if (!m_override_data)
    {
      nfo.GetDetails(tag, content);
      return CInfoScanner::InfoType::FULL;
    }
    else
    {
      /* TODO: Investigate if this is correct.
       * The first parameter to `CNfoFile::Create` is the **path** to the NFO file.
       * `content` here appears to be the __contents__ of an NFO file.
       * If this assumption is correct the parsing will always fail and
       * `nfo.ScraperUrl()` will always return an empty URL.
       */
      nfo.Create(content, m_info);
      m_url = nfo.ScraperUrl();
      return CInfoScanner::InfoType::URL;
    }
  }

  AVDictionaryEntry* avtag = nullptr;
  bool hastag = false;
  while ((avtag = av_dict_get(m_fctx->metadata, "", avtag, AV_DICT_IGNORE_SUFFIX)))
  {
    if (StringUtils::CompareNoCase(avtag->key, "imdburl") == 0 ||
        StringUtils::CompareNoCase(avtag->key, "tmdburl") == 0)
    {
      CNfoFile nfo;
      nfo.Create(avtag->value, m_info);
      m_url = nfo.ScraperUrl();
      return CInfoScanner::InfoType::URL;
    }
    else if (StringUtils::CompareNoCase(avtag->key, "title") == 0)
      tag.SetTitle(avtag->value);
    else if (StringUtils::CompareNoCase(avtag->key, "director") == 0)
    {
      std::vector<std::string> dirs = StringUtils::Split(avtag->value, " / ");
      tag.SetDirector(dirs);
    }

Review comment (bug):
idk if this is temporary and you fix this on this PR, otherwise please adjust as

```suggestion
      /*! @todo: Investigate if this is correct.
       *! The first parameter to `CNfoFile::Create` is the **path** to the NFO file.
       *! `content` here appears to be the __contents__ of an NFO file.
       *! If this assumption is correct the parsing will always fail and
       *! `nfo.ScraperUrl()` will always return an empty URL.
       */
```

Code after:
      const size_t size = stream->attached_pic.size;
      if (art)
        art->emplace_back(stream->attached_pic.data, size, mimeTag->value, type);
      else
        tag.m_coverArt.emplace_back(size, mimeTag->value, type);
    }
  }

  if (m_metadata_stream != -1)
  {
    CNfoFile nfo;
    auto* data = m_fctx->streams[m_metadata_stream]->codecpar->extradata;
    const char* content = reinterpret_cast<const char*>(data);
    if (!m_override_data)
    {
      nfo.GetDetails(tag, content);
      return CInfoScanner::InfoType::FULL;
    }
    else
    {
      /*! @todo Investigate if this is correct.
       * The first parameter to `CNfoFile::Create` is the **path** to the NFO file.
       * `content` here appears to be the __contents__ of an NFO file.
       * If this assumption is correct the parsing will always fail and
       * `nfo.ScraperUrl()` will always return an empty URL.
       */
      nfo.Create(content, m_info);
      m_url = nfo.ScraperUrl();
      return CInfoScanner::InfoType::URL;
    }
  }

  AVDictionaryEntry* avtag = nullptr;
  bool hastag = false;
  while ((avtag = av_dict_get(m_fctx->metadata, "", avtag, AV_DICT_IGNORE_SUFFIX)))
  {
    if (StringUtils::CompareNoCase(avtag->key, "imdburl") == 0 ||
        StringUtils::CompareNoCase(avtag->key, "tmdburl") == 0)
    {
      CNfoFile nfo;
      nfo.Create(avtag->value, m_info);
      m_url = nfo.ScraperUrl();
      return CInfoScanner::InfoType::URL;
    }
    else if (StringUtils::CompareNoCase(avtag->key, "title") == 0)
      tag.SetTitle(avtag->value);
    else if (StringUtils::CompareNoCase(avtag->key, "director") == 0)
    {
      std::vector<std::string> dirs = StringUtils::Split(avtag->value, " / ");
      tag.SetDirector(dirs);
    }