Skip to content

Commit

Permalink
improved: [TMDB] new API handling
Browse files Browse the repository at this point in the history
All modules and scrapers use now one instance each that created only one
time. That should prevent the "Call GetConfig() or SetConfig() first"
bug.

Error catching is still not implemented to get possible errors from
users!
  • Loading branch information
DanCooper committed Mar 22, 2018
1 parent 4d69ada commit 9f87d9e
Show file tree
Hide file tree
Showing 9 changed files with 1,639 additions and 1,729 deletions.
2,367 changes: 1,178 additions & 1,189 deletions Addons/scraper.TMDB.Data/Scraper/clsScrapeTMDB.vb

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions Addons/scraper.TMDB.Data/Scraper/dlgTMDBSearchResults_Movie.vb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ Public Class dlgTMDBSearchResults_Movie

Shared logger As Logger = LogManager.GetCurrentClassLogger()

Friend WithEvents bwDownloadPic As New System.ComponentModel.BackgroundWorker
Friend WithEvents bwDownloadPic As New ComponentModel.BackgroundWorker
Friend WithEvents tmrLoad As New Timer
Friend WithEvents tmrWait As New Timer

Private _TMDB As TMDB.Scraper
Private _TMDB As clsAPITMDB
Private sHTTP As New HTTP
Private _currnode As Integer = -1
Private _prevnode As Integer = -2
Expand All @@ -59,7 +59,7 @@ Public Class dlgTMDBSearchResults_Movie

#Region "Methods"

Public Sub New(ByVal SpecialSettings As TMDB_Data.SpecialSettings, ByRef TMDB As TMDB.Scraper)
Public Sub New(ByVal SpecialSettings As TMDB_Data.SpecialSettings, ByRef TMDB As clsAPITMDB)
' This call is required by the designer.
InitializeComponent()
Left = Master.AppPos.Left + (Master.AppPos.Width - Width) \ 2
Expand Down Expand Up @@ -88,7 +88,7 @@ Public Class dlgTMDBSearchResults_Movie
Return ShowDialog()
End Function

Public Overloads Function ShowDialog(ByVal Res As TMDB.SearchResults_Movie, ByVal sMovieTitle As String, ByVal sMovieFilename As String) As DialogResult
Public Overloads Function ShowDialog(ByVal Res As SearchResults_Movie, ByVal sMovieTitle As String, ByVal sMovieFilename As String) As DialogResult
tmrWait.Enabled = False
tmrWait.Interval = 250
tmrLoad.Enabled = False
Expand Down Expand Up @@ -285,7 +285,7 @@ Public Class dlgTMDBSearchResults_Movie
End If
End Sub

Private Sub SearchResultsDownloaded(ByVal M As TMDB.SearchResults_Movie)
Private Sub SearchResultsDownloaded(ByVal M As SearchResults_Movie)
tvResults.Nodes.Clear()
ClearInfo()
If M IsNot Nothing AndAlso M.Matches.Count > 0 Then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Public Class dlgTMDBSearchResults_MovieSet
Friend WithEvents tmrLoad As New Timer
Friend WithEvents tmrWait As New Timer

Private _TMDB As TMDB.Scraper
Private _TMDB As clsAPITMDB
Private sHTTP As New HTTP
Private _currnode As Integer = -1
Private _prevnode As Integer = -2
Expand Down Expand Up @@ -58,7 +58,7 @@ Public Class dlgTMDBSearchResults_MovieSet

#Region "Methods"

Public Sub New(ByVal SpecialSettings As TMDB_Data.SpecialSettings, TMDB As TMDB.Scraper)
Public Sub New(ByVal SpecialSettings As TMDB_Data.SpecialSettings, TMDB As clsAPITMDB)

' This call is required by the designer.
InitializeComponent()
Expand Down Expand Up @@ -86,7 +86,7 @@ Public Class dlgTMDBSearchResults_MovieSet
Return ShowDialog()
End Function

Public Overloads Function ShowDialog(Res As TMDB.SearchResults_MovieSet, ByVal sMovieSetTitle As String) As DialogResult
Public Overloads Function ShowDialog(Res As SearchResults_MovieSet, ByVal sMovieSetTitle As String) As DialogResult
tmrWait.Enabled = False
tmrWait.Interval = 250
tmrLoad.Enabled = False
Expand Down Expand Up @@ -270,7 +270,7 @@ Public Class dlgTMDBSearchResults_MovieSet
End If
End Sub

Private Sub SearchResultsDownloaded_MovieSet(ByVal M As TMDB.SearchResults_MovieSet)
Private Sub SearchResultsDownloaded_MovieSet(ByVal M As SearchResults_MovieSet)
tvResults.Nodes.Clear()
ClearInfo()
If M IsNot Nothing AndAlso M.Matches.Count > 0 Then
Expand Down
8 changes: 4 additions & 4 deletions Addons/scraper.TMDB.Data/Scraper/dlgTMDBSearchResults_TV.vb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Public Class dlgTMDBSearchResults_TV
Friend WithEvents tmrLoad As New Timer
Friend WithEvents tmrWait As New Timer

Private _TMDB As TMDB.Scraper
Private _TMDB As clsAPITMDB
Private sHTTP As New HTTP
Private _currnode As Integer = -1
Private _prevnode As Integer = -2
Expand All @@ -58,7 +58,7 @@ Public Class dlgTMDBSearchResults_TV

#Region "Methods"

Public Sub New(ByVal SpecialSettings As TMDB_Data.SpecialSettings, TMDB As TMDB.Scraper)
Public Sub New(ByVal SpecialSettings As TMDB_Data.SpecialSettings, TMDB As clsAPITMDB)
' This call is required by the designer.
InitializeComponent()
Left = Master.AppPos.Left + (Master.AppPos.Width - Width) \ 2
Expand Down Expand Up @@ -86,7 +86,7 @@ Public Class dlgTMDBSearchResults_TV
Return ShowDialog()
End Function

Public Overloads Function ShowDialog(ByVal Res As TMDB.SearchResults_TVShow, ByVal sShowTitle As String, ByVal sShowPath As String) As DialogResult
Public Overloads Function ShowDialog(ByVal Res As SearchResults_TVShow, ByVal sShowTitle As String, ByVal sShowPath As String) As DialogResult
tmrWait.Enabled = False
tmrWait.Interval = 250
tmrLoad.Enabled = False
Expand Down Expand Up @@ -293,7 +293,7 @@ Public Class dlgTMDBSearchResults_TV
End If
End Sub

Private Sub SearchResultsDownloaded(ByVal M As TMDB.SearchResults_TVShow)
Private Sub SearchResultsDownloaded(ByVal M As SearchResults_TVShow)
tvResults.Nodes.Clear()
ClearInfo()
If M IsNot Nothing AndAlso M.Matches.Count > 0 Then
Expand Down
Loading

0 comments on commit 9f87d9e

Please sign in to comment.