PageRenderTime 108ms CodeModel.GetById 104ms app.highlight 1ms RepoModel.GetById 2ms app.codeStats 0ms

/NfoLibrary/TV/TvShow.Scrapping.vb

#
Visual Basic | 33 lines | 23 code | 10 blank | 0 comment | 0 complexity | 09a94bfc72f2ca6400659acaf1db83b6 MD5 | raw file
 1Imports Media_Companion
 2
 3Partial Public Class TvShow
 4    Public Property TvdbData As Media_Companion.Tvdb.ShowData
 5
 6
 7    Public Property FanartData As New FanartScraper.Fanart
 8    Public Sub DownloadFanartData()
 9        Dim Data As String = Utilities.DownloadTextFiles("http://fanart.tv/api/fanart.php?id=" & Me.TvdbId.Value)
10
11        FanartData.LoadXml(Data)
12        FanartData.FolderPath = Me.FolderPath
13
14        If FanartData.ClearArts.Count > 0 Then
15            FanartData.ClearArts.Item(0).DownloadFile()
16        End If
17
18        If FanartData.ClearLogos.Count > 0 Then
19            FanartData.ClearLogos.Item(0).DownloadFile()
20        End If
21
22        If FanartData.TvThumbs.Count > 0 Then
23            FanartData.TvThumbs.Item(0).DownloadFile()
24        End If
25    End Sub
26
27    Public Sub Scrape(Optional ByVal IgnoreCache As Boolean = False)
28        Dim ScrapeTask As Tasks.ScrapeShowTask = New Tasks.ScrapeShowTask(Me)
29
30        Common.Tasks.Add(ScrapeTask)
31    End Sub
32
33End Class