Ejemplo n.º 1
0
        public static void Send_Media(List <VideoLocal> locals)
        {
            //if (!ServerSettings.WebCache_XRefFileEpisode_Send) return;

            string uri = string.Format(@"http://{0}/api/Media", azureHostBaseAddress);

            List <MediaInput> inputs = new List <MediaInput>();

            // send a max of 25 at a time
            // send a max of 25 at a time
            foreach (VideoLocal v in locals.Where(a => a.MediaBlob != null && a.MediaBlob.Length > 0 && a.MediaVersion == VideoLocal.MEDIA_VERSION && !string.IsNullOrEmpty(a.ED2KHash)))
            {
                MediaInput input = new MediaInput(v);
                if (inputs.Count < 25)
                {
                    inputs.Add(input);
                }
                else
                {
                    string json = JsonConvert.SerializeObject(inputs);
                    //json = Newtonsoft.Json.JsonConvert.SerializeObject(inputs);
                    SendData(uri, json, "POST");
                    inputs.Clear();
                }
            }

            if (inputs.Count > 0)
            {
                string json = JsonConvert.SerializeObject(inputs);
                SendData(uri, json, "POST");
            }
        }
Ejemplo n.º 2
0
        public static void Send_Media(string ed2k, JMMContracts.PlexAndKodi.Media media)
        {
            //if (!ServerSettings.WebCache_XRefFileEpisode_Send) return;

            string uri = string.Format(@"http://{0}/api/Media", azureHostBaseAddress);

            List <MediaInput> inputs = new List <MediaInput>();
            MediaInput        input  = new MediaInput(ed2k, media);

            inputs.Add(input);
            string json = JsonConvert.SerializeObject(inputs);

            SendData(uri, json, "POST");
        }
Ejemplo n.º 3
0
        public static void Send_Media(string ed2k, JMMContracts.PlexAndKodi.Media media)
        {
            //if (!ServerSettings.WebCache_XRefFileEpisode_Send) return;

            string uri = string.Format(@"http://{0}/api/Media", azureHostBaseAddress);

            List<MediaInput> inputs = new List<MediaInput>();
            MediaInput input = new MediaInput(ed2k, media);
            inputs.Add(input);
            string json = JsonConvert.SerializeObject(inputs);
            SendData(uri, json, "POST");
        }
Ejemplo n.º 4
0
        public static void Send_Media(List<VideoLocal> locals)
        {
            //if (!ServerSettings.WebCache_XRefFileEpisode_Send) return;

            string uri = string.Format(@"http://{0}/api/Media", azureHostBaseAddress);

            List<MediaInput> inputs = new List<MediaInput>();
            // send a max of 25 at a time
            // send a max of 25 at a time
            foreach (VideoLocal v in locals.Where(a=>a.MediaBlob!=null && a.MediaBlob.Length>0 && a.MediaVersion==VideoLocal.MEDIA_VERSION && !string.IsNullOrEmpty(a.ED2KHash)))
            {
                MediaInput input = new MediaInput(v);
                if (inputs.Count < 25)
                    inputs.Add(input);
                else
                {
                    string json = JsonConvert.SerializeObject(inputs);
                    //json = Newtonsoft.Json.JsonConvert.SerializeObject(inputs);
                    SendData(uri, json, "POST");
                    inputs.Clear();
                }
            }

            if (inputs.Count > 0)
            {
                string json = JsonConvert.SerializeObject(inputs);
                SendData(uri, json, "POST");
            }
        }