From 0003b0118987f5e8fcfea3c1a4c5e87a426cb430 Mon Sep 17 00:00:00 2001 From: Joe Germuska Date: Thu, 9 Jan 2014 10:16:38 -0600 Subject: [PATCH] Change method for extracting photo id from Flickr URL. Closes #556 --- source/js/Core/Media/VMM.MediaType.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/js/Core/Media/VMM.MediaType.js b/source/js/Core/Media/VMM.MediaType.js index 3bc85ee..5178d07 100644 --- a/source/js/Core/Media/VMM.MediaType.js +++ b/source/js/Core/Media/VMM.MediaType.js @@ -84,11 +84,13 @@ if(typeof VMM != 'undefined' && typeof VMM.MediaType == 'undefined') { media.user = d.split("google.com/")[1].split("/posts/")[0]; } success = true; - } else if (d.match("flickr.com/photos")) { + } else if (d.match("flickr.com/photos/")) { media.type = "flickr"; - media.id = d.split("photos\/")[1].split("/")[1]; + var pos = d.indexOf("flickr.com/photos/") + "flickr.com/photos/".length; + var photo_info = d.substr(pos) + media.id = photo_info.split("/")[1]; media.link = d; - success = true; + success = Boolean(media.id); } else if (d.match("instagr.am/p/")) { media.type = "instagram"; media.link = d;