OSDN Git Service

pbs.twimg.com のサムネイル表示に使用する正規表現の誤りを修正
[opentween/open-tween.git] / OpenTween / Thumbnail / ThumbnailGenerator.cs
index 8caea6e..096abcb 100644 (file)
@@ -56,9 +56,9 @@ namespace OpenTween.Thumbnail
 
                 // pic.twitter.com
                 new SimpleThumbnailService(
-                    @"^https?://pbs\.twimg\.com/.*$",
-                    "${0}",
-                    "${0}:orig"),
+                    @"^(https?://pbs\.twimg\.com/[^:]+)(?:\:.+)?$",
+                    "${1}",
+                    "${1}:orig"),
 
                 // youtube
                 new Youtube(),
@@ -236,13 +236,9 @@ namespace OpenTween.Thumbnail
             if (post.PostGeo != null)
             {
                 var map = MapThumb.GetDefaultInstance();
-                var point = post.PostGeo.Value;
-                thumbnails.Add(new ThumbnailInfo()
-                {
-                    ImageUrl = map.CreateMapLinkUrl(point.Latitude, point.Longitude),
-                    ThumbnailUrl = map.CreateStaticMapUrl(point.Latitude, point.Longitude),
-                    TooltipText = null,
-                });
+                var thumb = await map.GetThumbnailInfoAsync(post.PostGeo.Value)
+                    .ConfigureAwait(false);
+                thumbnails.Add(thumb);
             }
 
             return thumbnails;