Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
104 changes: 73 additions & 31 deletions Ember Media Manager/dlgSettings.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 16 additions & 0 deletions Ember Media Manager/dlgSettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1203,6 +1203,15 @@ Public Class dlgSettings
Me.SetApplyButton(True)
End Sub

Private Sub chkUseTVMIDuration_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkUseMIDuration.CheckedChanged, chkUseTVMIDuration.CheckedChanged
Me.txtTVRuntimeFormat.Enabled = Me.chkUseTVMIDuration.Checked
Me.SetApplyButton(True)
End Sub

Private Sub txtTVRuntimeFormat_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles txtRuntimeFormat.TextChanged, txtTVRuntimeFormat.TextChanged
Me.SetApplyButton(True)
End Sub

Private Sub chkEpLockTitle_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkEpLockTitle.CheckedChanged
Me.SetApplyButton(True)
End Sub
Expand Down Expand Up @@ -2004,6 +2013,8 @@ Public Class dlgSettings
Me.SetApplyButton(True)
End Sub



Private Sub chkVideoTSParent_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs)
Me.SetApplyButton(True)
Me.sResult.NeedsUpdate = True
Expand Down Expand Up @@ -2300,6 +2311,9 @@ Public Class dlgSettings
Me.chkUseMIDuration.Checked = Master.eSettings.UseMIDuration
Me.txtRuntimeFormat.Enabled = Master.eSettings.UseMIDuration
Me.txtRuntimeFormat.Text = Master.eSettings.RuntimeMask
Me.chkUseTVMIDuration.Checked = Master.eSettings.TVUseMIDuration
Me.txtTVRuntimeFormat.Enabled = Master.eSettings.TVUseMIDuration
Me.txtTVRuntimeFormat.Text = Master.eSettings.TVRuntimeMask
Me.chkUseImgCache.Checked = Master.eSettings.UseImgCache
Me.chkUseImgCacheUpdaters.Checked = Master.eSettings.UseImgCacheUpdaters
Me.chkPersistImgCache.Checked = Master.eSettings.PersistImgCache
Expand Down Expand Up @@ -3368,6 +3382,8 @@ Public Class dlgSettings
End If
Master.eSettings.UseMIDuration = Me.chkUseMIDuration.Checked
Master.eSettings.RuntimeMask = Me.txtRuntimeFormat.Text
Master.eSettings.TVUseMIDuration = Me.chkUseTVMIDuration.Checked
Master.eSettings.TVRuntimeMask = Me.txtTVRuntimeFormat.Text
Master.eSettings.UseImgCache = Me.chkUseImgCache.Checked
Master.eSettings.UseImgCacheUpdaters = Me.chkUseImgCacheUpdaters.Checked
Master.eSettings.PersistImgCache = Me.chkPersistImgCache.Checked
Expand Down
8 changes: 4 additions & 4 deletions EmberAPI/clsAPIMediaInfo.vb
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ Public Class MediaInfo
If miMovie.Movie.FileInfo.StreamDetails.Video.Count > 0 AndAlso Master.eSettings.UseMIDuration Then
Dim tVid As MediaInfo.Video = NFO.GetBestVideo(miMovie.Movie.FileInfo)
If Not String.IsNullOrEmpty(tVid.Duration) Then
miMovie.Movie.Runtime = MediaInfo.FormatDuration(MediaInfo.DurationToSeconds(tVid.Duration, True))
miMovie.Movie.Runtime = MediaInfo.FormatDuration(MediaInfo.DurationToSeconds(tVid.Duration, True), Master.eSettings.RuntimeMask)
End If
End If
MI = Nothing
Expand Down Expand Up @@ -376,7 +376,7 @@ Public Class MediaInfo
End If
End Function

Private Shared Function DurationToSeconds(ByVal Duration As String, ByVal Reverse As Boolean) As String
Public Shared Function DurationToSeconds(ByVal Duration As String, ByVal Reverse As Boolean) As String
If Not String.IsNullOrEmpty(Duration) Then
If Reverse Then
Dim ts As New TimeSpan(0, 0, Convert.ToInt32(Duration))
Expand Down Expand Up @@ -515,12 +515,12 @@ Public Class MediaInfo
Return fiOut
End Function

Private Shared Function FormatDuration(ByVal tDur As String) As String
Public Shared Function FormatDuration(ByVal tDur As String, ByVal sMask As String) As String
Dim sDuration As Match = Regex.Match(tDur, "(([0-9]+)h)?\s?(([0-9]+)mn)?\s?(([0-9]+)s)?")
Dim sHour As Integer = If(Not String.IsNullOrEmpty(sDuration.Groups(2).Value), (Convert.ToInt32(sDuration.Groups(2).Value)), 0)
Dim sMin As Integer = If(Not String.IsNullOrEmpty(sDuration.Groups(4).Value), (Convert.ToInt32(sDuration.Groups(4).Value)), 0)
Dim sSec As Integer = If(Not String.IsNullOrEmpty(sDuration.Groups(6).Value), (Convert.ToInt32(sDuration.Groups(6).Value)), 0)
Dim sMask As String = Master.eSettings.RuntimeMask

'Dim sRuntime As String = String.Empty

If sMask.Contains("<h>") Then
Expand Down
6 changes: 5 additions & 1 deletion EmberAPI/clsAPINFO.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1057,7 +1057,11 @@ Public Class NFO
For Each tVid As MediaInfo.Video In _TVEpDB.TVEp.FileInfo.StreamDetails.Video
cTotal = cTotal + tVid.Duration
Next
_TVEpDB.TVEp.Runtime = cTotal
If Master.eSettings.TVUseMIDuration Then
_TVEpDB.TVEp.Runtime = MediaInfo.FormatDuration(MediaInfo.DurationToSeconds(cTotal, True), Master.eSettings.TVRuntimeMask)
Else
_TVEpDB.TVEp.Runtime = cTotal
End If
End If
Catch ex As Exception
Master.eLog.WriteToErrorLog(ex.Message, ex.StackTrace, "Error")
Expand Down
20 changes: 20 additions & 0 deletions EmberAPI/clsAPISettings.vb
Original file line number Diff line number Diff line change
Expand Up @@ -320,10 +320,12 @@ Public Class Settings
Private _tvflaglang As String
Private _tvignorelastscan As Boolean
Private _tvmetadatapertype As List(Of MetadataPerType)
Private _tvruntimemask As String
Private _tvscanordermodify As Boolean
Private _tvshowregexes As List(Of TVShowRegEx)
Private _tvshowtheme As String
Private _tvupdatetime As Enums.TVUpdateTime
Private _tvusemiduration As Boolean
Private _updatertrailers As Boolean
Private _updatertrailersnodownload As Boolean
Private _usecertformpaa As Boolean
Expand Down Expand Up @@ -2984,6 +2986,15 @@ Public Class Settings
End Set
End Property

Public Property TVRuntimeMask() As String
Get
Return Me._tvruntimemask
End Get
Set(ByVal value As String)
Me._tvruntimemask = value
End Set
End Property

Public Property TVScanOrderModify() As Boolean
Get
Return Me._tvscanordermodify
Expand Down Expand Up @@ -3020,6 +3031,15 @@ Public Class Settings
End Set
End Property

Public Property TVUseMIDuration() As Boolean
Get
Return Me._tvusemiduration
End Get
Set(ByVal value As Boolean)
Me._tvusemiduration = value
End Set
End Property

Public Property UpdaterTrailers() As Boolean
Get
Return Me._updatertrailers
Expand Down