~unity-team/thumbnailer/devel

« back to all changes in this revision

Viewing changes to src/ubuntuserverdownloader.cpp

  • Committer: Tarmac
  • Author(s): Michi Henning
  • Date: 2017-02-07 04:03:30 UTC
  • mfrom: (365.4.12 snap)
  • Revision ID: tarmac-20170207040330-67dv5bt91rny2t1k
Adjust paths when running in a snap. Decision whether to adjust paths is now made at compile time. Also consolidated all the environment variable accesses into an EnvVar helper class.
Added home interface to service and admin tool for the time being. This allows local thumbnailing to work (but the apparmor credentials check is currently not doing the right thing).
videos don't thumbnail yet because we are not bundling the gstreamer codecs, I suspect.

Approved by James Henstridge, unity-api-1-bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
    return key;
100
100
}
101
101
 
102
 
char const* server_url()
103
 
{
104
 
    char const* server_url = DFLT_SERVER_URL;
105
 
    char const* override_url = getenv(thumbnailer::internal::UBUNTU_SERVER_URL);
106
 
    if (override_url && *override_url)
107
 
    {
108
 
        server_url = override_url;
109
 
    }
110
 
    return server_url;
111
 
}
112
 
 
113
102
}  // namespace
114
103
 
115
104
class UbuntuServerArtReply : public ArtReply
279
268
                                                            QString const& album,
280
269
                                                            chrono::milliseconds timeout)
281
270
{
282
 
    auto url = make_art_url(server_url(), ALBUM_ART_BASE_URL, artist, album, api_key_);
 
271
    auto url = make_art_url(EnvVars::get_ubuntu_server_url(), ALBUM_ART_BASE_URL, artist, album, api_key_);
283
272
    return download_url(url, timeout);
284
273
}
285
274
 
287
276
                                                             QString const& album,
288
277
                                                             chrono::milliseconds timeout)
289
278
{
290
 
    auto url = make_art_url(server_url(), ARTIST_ART_BASE_URL, artist, album, api_key_);
 
279
    auto url = make_art_url(EnvVars::get_ubuntu_server_url(), ARTIST_ART_BASE_URL, artist, album, api_key_);
291
280
    return download_url(url, timeout);
292
281
}
293
282