Ejemplo n.º 1
0
        public void LoadNode()
        {
            var comm     = new TvhCommunication(_logger, _settings);
            var response = comm.Post("/api/idnode/load", "uuid=f9a34473d1930d2ecd82c10ccbdb42f7&meta=1");

            response.Should().NotBeNull();
        }
Ejemplo n.º 2
0
        public bool CreateOnTvh(TvhCommunication comm)
        {
            if (State != State.New)
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(CreateUrl))
            {
                return(false);
            }
            var response = comm.Post(CreateUrl, CreateData);

            Logger.InfoFormat($"Created {GetType().Name} on tvheadend with id {response}. Give it 5 sec to initialize");
            comm.WaitUntilScanCompleted();
            return(true);
        }
Ejemplo n.º 3
0
        public bool UpdateOnTvh(TvhCommunication comm)
        {
            if (State != State.Loaded)
            {
                return(false);
            }
            if (string.IsNullOrWhiteSpace(UpdateUrl))
            {
                return(false);
            }
            var response = comm.Post(UpdateUrl, UpdateData);

            if (response == "{}")
            {
                response = "OK";
            }
            Logger.InfoFormat($"Updated {GetType().Name} on tvheadend with response: {response}");
            return(!string.IsNullOrWhiteSpace(response));
        }