示例#1
0
        // =============================================
        // Library Syncing Functions
        // =============================================
        public IEnumerable<CacheModel> PushToServer(ContentModel[] results)
        {
            var service = InitializeClient();

            var updates = new List<CacheModel>();

            const int batchSize = 50;
            var counter = 0;

            do
            {
                var cache = service.PushMediaInformation(_serverKey, results.Skip(counter).Take(batchSize).ToArray());

                updates.AddRange(cache);

                counter += batchSize;

            #if DEBUG
                System.Console.WriteLine("{0}%", counter / results.Length);
                foreach (var c in cache)
                {
                    System.Console.WriteLine("{0}==={1}", c.ServerMediaId, c.Hash);
                }
            #endif

            } while (counter < results.Count());

            //#if DEBUG
            //            System.Console.WriteLine("Completed Uploading");
            //#endif

            return updates;
        }