m_media_new: Store input URL in unescaped form
authorToni Gundogdu <legatvs@gmail.com>
Mon, 14 Oct 2013 13:10:03 +0000 (14 16:10 +0300)
committerToni Gundogdu <legatvs@gmail.com>
Tue, 15 Oct 2013 14:37:03 +0000 (15 17:37 +0300)
Signed-off-by: Toni Gundogdu <legatvs@gmail.com>
src/misc/media.c

index ba4ed35..96ee8d7 100644 (file)
 /* -- */
 #include "misc/media.h"
 #include "misc/slst.h"
+#include "misc/url.h"
 
 gpointer m_media_new(_quvi_t q, const gchar *url)
 {
-  _quvi_media_t qm = g_new0(struct _quvi_media_s, 1);
-  /* URL */
+  _quvi_media_t qm;
+  gchar *u;
+
+  qm = g_new0(struct _quvi_media_s, 1);
+
   qm->url.redirect_to = g_string_new(NULL);
   qm->url.thumbnail = g_string_new(NULL);
-  qm->url.input = g_string_new(url);
-  /* Handle */
-  qm->handle.quvi = q;
-  /* Other */
+
+  /*
+   * Store the input URL in the unescaped form which is what the `ident'
+   * functions of the scripts expect when the support check is run
+   * offline.
+   */
+  u = m_url_unescaped_form(url);
+  qm->url.input = g_string_new(u);
+  g_free(u);
+
   qm->title = g_string_new(NULL);
   qm->id = g_string_new(NULL);
+  qm->handle.quvi = q;
+
   return (qm);
 }