save chapters in xml

This commit is contained in:
Luke Pulverenti 2014-05-14 16:43:31 -04:00
parent 8eb74757d7
commit 4b585e3148
2 changed files with 22 additions and 15 deletions

View File

@ -255,7 +255,9 @@ namespace MediaBrowser.Providers.MediaInfo
} }
} }
info.StartPositionTicks = chapter.start / 100; // Limit accuracy to milliseconds to match xml saving
var ms = Math.Round(TimeSpan.FromTicks(chapter.start / 100).TotalMilliseconds);
info.StartPositionTicks = TimeSpan.FromMilliseconds(ms).Ticks;
return info; return info;
} }

View File

@ -636,22 +636,27 @@ namespace MediaBrowser.Providers.Savers
{ {
var video = item as Video; var video = item as Video;
if (video != null && video.Video3DFormat.HasValue) if (video != null)
{ {
switch (video.Video3DFormat.Value) AddChapters(video, builder, itemRepository);
if (video.Video3DFormat.HasValue)
{ {
case Video3DFormat.FullSideBySide: switch (video.Video3DFormat.Value)
builder.Append("<Format3D>FSBS</Format3D>"); {
break; case Video3DFormat.FullSideBySide:
case Video3DFormat.FullTopAndBottom: builder.Append("<Format3D>FSBS</Format3D>");
builder.Append("<Format3D>FTAB</Format3D>"); break;
break; case Video3DFormat.FullTopAndBottom:
case Video3DFormat.HalfSideBySide: builder.Append("<Format3D>FTAB</Format3D>");
builder.Append("<Format3D>HSBS</Format3D>"); break;
break; case Video3DFormat.HalfSideBySide:
case Video3DFormat.HalfTopAndBottom: builder.Append("<Format3D>HSBS</Format3D>");
builder.Append("<Format3D>HTAB</Format3D>"); break;
break; case Video3DFormat.HalfTopAndBottom:
builder.Append("<Format3D>HTAB</Format3D>");
break;
}
} }
} }
} }