Luke 37188 Posted January 8, 2014 Share Posted January 8, 2014 have you tried the swagger docs? you can get to them from the dashboard in the links section. that links section also has a github link with api documentation as well Link to comment Share on other sites More sharing options...
TinkeringTot 3 Posted January 8, 2014 Share Posted January 8, 2014 I am familiar with java and javascript. However, I'm not familiar enough to know what/how to use an API. I code in Notepad++ or Eclipse. Is it possible to view/use the API in these? Link to comment Share on other sites More sharing options...
TinkeringTot 3 Posted January 8, 2014 Share Posted January 8, 2014 have you tried the swagger docs? you can get to them from the dashboard in the links section. that links section also has a github link with api documentation as well Thanks! That is exactly what I was looking for. The swagger part. I still have no idea what to do with the API documentation. Link to comment Share on other sites More sharing options...
Luke 37188 Posted January 8, 2014 Author Share Posted January 8, 2014 Hi, welcome. What are you trying to do? Link to comment Share on other sites More sharing options...
Luke 37188 Posted January 8, 2014 Author Share Posted January 8, 2014 the web client source code has lots of examples https://github.com/MediaBrowser/MediaBrowser/tree/master/MediaBrowser.WebDashboard/dashboard-ui Link to comment Share on other sites More sharing options...
TinkeringTot 3 Posted January 8, 2014 Share Posted January 8, 2014 (edited) I want to be able to access the data. Currently I'm trying to improve on the text list of each collection that MonGooseMan made. I want to see a list of the available calls so I can add the year to each name, and have a while statement for each collection that will list those out. Edited January 7, 2014 by TinkeringTot Link to comment Share on other sites More sharing options...
Cheesegeezer 3089 Posted January 16, 2014 Share Posted January 16, 2014 Thanks! That is helpful. I've managed to do a few things of little importance. Is there a sub forum with a group of people that wouldn't mind helping me through an issue or two as I learn? The issue may not be related to the API. I would just use this thread, unfortunately i'm no good with JS so cant help. Link to comment Share on other sites More sharing options...
TinkeringTot 3 Posted January 16, 2014 Share Posted January 16, 2014 Thanks! That is helpful. I've managed to do a few things of little importance. Is there a sub forum with a group of people that wouldn't mind helping me through an issue or two as I learn? The issue may not be related to the API. Link to comment Share on other sites More sharing options...
TinkeringTot 3 Posted January 16, 2014 Share Posted January 16, 2014 Alright, I am working with a script Mongoose made that I linked to above. I've added years, ratings, and code to run through boxsets. Though my boxsets all end up at the very end of the div. I'm not sure why. Can anyone offer some assistance? https://drive.google.com/file/d/0BybYJG8wuuLnVWJ0dnFfOHBfeVk/edit?usp=sharing <html> <head> <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script> </head> <body> <div id="server"> <p>Enter the details of your server</p> IP Address (eg 192.168.1.100)<input type="text" id="serverField" value="192.168.1.100"/><br/> Port (normally 8096)<input type="text" id="serverPort" value="8096"/><br/> <p> <input type="button" id="serverButton" value="Go"/> </div> <div id="userChoice" style="display:none"> Choose a user: </div> <div id="collectionChoice" style="display:none"> Choose a collection: </div> <div id="collectionView" style="display:none"> </div> <script> var serverIP; var userId; var collectionId; var serverPort; var collectionName; $("#serverButton").click(function(){ serverIP = $("#serverField").val(); serverPort = $("#serverPort").val(); $.getJSON('http://'+serverIP+':'+serverPort+'/mediabrowser/Users', function(data){ for(var j=0;j<data.length;j++) $("#userChoice").append("<br/><a href='#' onClick='userSelected(\""+data[j].Id+"\")'>"+data[j].Name+"</a>"); $("#server").hide(); $("#userChoice").show(); }); }); function userSelected(thisUserId) { userId=thisUserId; $.getJSON('http://'+serverIP+':'+serverPort+'/mediabrowser/Users/'+userId+'/Items?sortBy=SortName', function(data){ for(var j=0;j<data.Items.length;j++) $("#collectionChoice").append("<br/><a href='#' onClick='collectionSelected(\""+data.Items[j].Id+"\",\""+data.Items[j].Name+"\")'>"+data.Items[j].Name+"</a>"); $("#userChoice").hide(); $("#collectionChoice").show(); }); } function collectionSelected(thisCollectionId,thisCollectionName) { collectionId=thisCollectionId; //collectionId="ca943aab9c4ec8c8b08d4f8bac4b4fa0"; collectionName=thisCollectionName var premiereYear; var premiereDate; $("#collectionView").append("<br/><b>"+collectionName+"</b><br/>"); //$("#collectionView").append('<br/>http://'+serverIP+':'+serverPort+'/mediabrowser/Users/'+userId+'/Items?sortBy=SortName&SortOrder=Ascending&Fields=DateCreated&StartIndex=0&Limit=2000&ParentId='+collectionId+'&Filters=&NameStartsWithOrGreater='); $.getJSON('http://'+serverIP+':'+serverPort+'/mediabrowser/Users/'+userId+'/Items?sortBy=SortName&SortOrder=Ascending&Fields=DateCreated&StartIndex=0&Limit=2000&ParentId='+collectionId+'&Filters=&NameStartsWithOrGreater=', function(data){ for(var j=0;j<data.Items.length;j++){ premiereDate=""+data.Items[j].PremiereDate; if(premiereDate == "undefined"){ premiereYear=""; } else { premiereYear="("+premiereDate.substr(0,4)+") "; } if (data.Items[j].Type == "BoxSet"){ //$("#collectionView").append("<br/>"+data.Items[j].Name+" "+premiereYear+" ("+data.Items[j].Type+") " +data.Items[j].Id); collectionSelected(data.Items[j].Id,data.Items[j].Name); } else { $("#collectionView").append("<br/>"+data.Items[j].Name+" ("+data.Items[j].OfficialRating+") "+premiereYear); } } $("#collectionChoice").hide(); $("#collectionView").show(); }); } </script> </body> </html> Link to comment Share on other sites More sharing options...
MongooseMan 31 Posted January 16, 2014 Share Posted January 16, 2014 At a guess (given 5 minutes of looking at the code) I'd say its because getJson is an async call, which JavaScript doesn't wait for. So, it'll finish appending all the non-boxset items before it gets the response from the getJson call and therefore appends those afterwards. Make sense? Link to comment Share on other sites More sharing options...
TinkeringTot 3 Posted January 17, 2014 Share Posted January 17, 2014 That makes sense. I've never worked with Json before. Looks like I've got some learning to do. Thanks Mongoose! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now