示例#1
0
        public ScreenSaverPlaylist GetScreenSaverPlaylist(Config entity)
        {
            ScreenSaverPlaylist playlist = null;

            if (entity.ScreenSaverPlaylist != null)
            {
                playlist = JsonConvert.DeserializeObject <ScreenSaverPlaylist>(entity.ScreenSaverPlaylist);
            }
            if (playlist == null)
            {
                playlist = new ScreenSaverPlaylist();
            }
            return(playlist);
        }
示例#2
0
 public void UpdateScreenSaverPlaylist(Config entity, ScreenSaverPlaylist model)
 {
     model.Medias = model.Medias?.OrderBy(m => m.Position).ToList();
     entity.ScreenSaverPlaylist = JsonConvert.SerializeObject(model);
 }