2009-05-19, 01:02
clackerdacker Wrote:All the files go in the VIDEO_TS directory so it's all nice and easy! The only difference in naming of the files I believe is that they need to be called video_ts.nfo and tbn if using the <movie>.nfo style approach.
Ok... so it can use movie.nfo or <movie>.nfo? And if <movie>.nfo is selected, use video_ts.nfo. Is that correct?
EDIT: So, for example -
Code:
Public Shared Sub SaveMovieToNFO(ByVal movieToSave As Media.Movie, ByVal sPath As String, ByVal isFile As Boolean)
'//
' Serialize Media.Movie to an NFO
'\\
Try
Dim tmpName As String = CleanStackingMarkers(GetNameFromPath(sPath))
Dim nPath As String = String.Concat(Directory.GetParent(sPath).FullName, "\", tmpName)
Dim xmlSer As New XmlSerializer(GetType(Media.Movie))
Dim tPath As String = String.Empty
If uSettings.MovieNameNFO OrElse isFile Then
If Directory.GetParent(sPath).Name.ToLower = "video_ts" Then
tPath = String.Concat(Directory.GetParent(sPath).FullName, "video_ts.nfo")
Else
tPath = String.Concat(RemoveExtFromPath(nPath), ".nfo")
End If
If Not File.Exists(tPath) OrElse (Not CBool(File.GetAttributes(tPath) And FileAttributes.ReadOnly)) Then
Dim xmlSW As New StreamWriter(tPath)
xmlSer.Serialize(xmlSW, movieToSave)
xmlSW.Close()
xmlSW.Dispose()
End If
End If
If Not isFile AndAlso uSettings.MovieNFO Then
tPath = String.Concat(Directory.GetParent(nPath).FullName.ToString, "\movie.nfo")
If Not File.Exists(tPath) OrElse (Not CBool(File.GetAttributes(tPath) And FileAttributes.ReadOnly)) Then
Dim xmlSW As New StreamWriter(tPath)
xmlSer.Serialize(xmlSW, movieToSave)
xmlSW.Close()
xmlSW.Dispose()
End If
End If
Catch ex As Exception
eLog.WriteToErrorLog(ex.Message, ex.StackTrace, "Error")
End Try
End Sub