~ci-train-bot/media-hub/media-hub-ubuntu-zesty-2212

« back to all changes in this revision

Viewing changes to src/core/media/metadata.cpp

  • Committer: Bileto Bot
  • Author(s): Jim Hodapp
  • Date: 2016-06-16 21:30:56 UTC
  • mfrom: (184.1.11 media-hub)
  • Revision ID: ci-train-bot@canonical.com-20160616213056-jhhrxbngi70c8yb7
Support albumart for music and video tracks.

Show diffs side-by-side

added added

removed removed

Lines of Context:
20
20
 
21
21
#include <core/media/track.h>
22
22
 
 
23
#include <glib.h>
 
24
 
23
25
namespace media = core::ubuntu::media;
24
26
 
 
27
std::string media::Track::MetaData::encode(const std::string& key) const
 
28
{
 
29
    if (not is_set(key))
 
30
        return std::string{};
 
31
 
 
32
    return std::string{g_uri_escape_string(map.at(key).c_str(),
 
33
                                            "!$&'()*+,;=:/?[]@", // Reserved chars
 
34
                                            true)};              // Allow UTF-8 chars
 
35
}
 
36
 
25
37
const std::string& media::Track::MetaData::album() const
26
38
{
27
39
    return map.at(xesam::Album::name);