• Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by Dragma

  1. Oh, good, it is not just me. Thought I did something wrong in my code again.
  2. Dragma

    Sets in set call.

    Just wondering, is there a reason why the set objects in the:/api/v3/lego/sets/{set_num}/sets/ dose not return the same info as the /api/v3/lego/sets/{set_num}/? for example: looking up K3731-1 in the first returns: "results": [ { "id": 2010, "set_num": "3731-1", "set_name": "Pumpkin Pack", "quantity": 2, "set_img_url": "https://m.rebrickable.com/media/sets/3731-1.jpg" } While 3731-1 in the latter returns: { "set_num": "3731-1", "name": "Pumpkin Pack", "year": 2000, "theme_id": 230, "num_parts": 87, "set_img_url": "https://m.rebrickable.com/media/sets/3731-1.jpg", "set_url": "https://rebrickable.com/sets/3731-1/pumpkin-pack/", "last_modified_dt": "2011-09-05T14:00:00Z" } Basically if you want to get all the info about a set that is contained within a set you need multiple calls. why not have them both return the same object with the single one setting a quantity of 1?
  3. Actually you may be able to. I was having an issue with this type of thing (with the exception of bar code, which I don't use) and the system I am using is useing the/api/v3/lego/sets/ to search for the sets that contain the base number then letting the user select the one they are looking for and using /api/v3/lego/sets/{set_num}/ to get the set in question. just a thought.
  4. Dragma

    throttle in API

    Just looking with what is returned with a call, you are not only getting the data you requested, but also a JSON Header, Now consider this, do you want 5000 chunks of text you will do nothing with, or just 28? I know what I would like.
  5. as per your API, they are both considered collections of Sets. What I do in that case, is loop through the collection and build a list of elements (part / color combos) that gets applied to the parent Set.
  6. Dragma

    throttle in API

    Well, you could always download the CSV files instead of calling the DB for each part. That should get most of them, then call the API for each part that is left.
  7. Dragma

    App Preferences?

    Just was wondering, what is everyone's data preference, to have one massive download when the app is installed and during updates, or to have to wait for each item to be imported? The benefit of the first is little lag on loading from the database, the second is overall size, the first few loads can be lengthy, but additional ones tend to take less as the database is filled. Downside to the first is for items that are not included in the update you would still need to wait, while in the second, the first few loads load can be lengthy. Currently my app uses the second approach, another App, Brickset states it uses the first approach. I figured that the user of mine would not need to know about anything other then what is in their collection. What would your preference be?
  8. I noticed the same thing. not sure what I will do to fix that. Maybe switch the selected part type image to something smaller so the fields are always visible (was testing on a tablet.) Well, Figured it out, setting that section on a fragment Dialog. will be much nicer.
  9. I never really expected it to be the next chrome. I just had an idea for this and thought maybe others would be able to get some use out of it. If I wanted to keep it for my self I would have stayed on a C# desktop App, which I unfortunately lost when the drive I had it on crashed. Sometimes I think this is cursed . But I figured there would be more people out there who were a bit like me with their collection.
  10. Heh, biodreamer, I think you may be taking the scope of the app a bit into left field so to speak, it is mainly used for people like myself that like to rebuild sets and don't want to spend a long amount of time hunting down the elements even if they are organised just because you forgot which Bin/Drawer you stashed it in. I had thought of designing a Bin/Drawer designer initially (I may still) but for the initial roll out decided to go with a simple set of text fields. Since I now understand your reasoning, I may yet have a go at this, I think I should be able to incorporate it into the existing setup, but graphics is still something I am not comfortable with. I would say we take this discussion to a different thread or through e-mail. I like the concept, but need to work some things in my head a bit.
  11. Thanks for the feedback, this is what I was hoping for. Linking will come, just it seems to be when ever I got to that point, soon after, the app corrupted and I could never figure out why. I noticed the same thing. not sure what I will do to fix that. Maybe switch the selected part type image to something smaller so the fields are always visible (was testing on a tablet.) The command is in the menu, you need to select the colors you want to update, then enter the Bin and Drawer, then tap Update Storage. You may have come across the initial save bug where the first set of elements you update the storage for don't save (I thought I had squashed that one, if you go back you should be able to save it a second time. (I was able to and had no further issues. This is a bug I was unaware of, good catch, I will get that fixed next release. Thanks for trying it out.
  12. Really moving drawers around is inevitable with any large Lego collection. keeping up with the moves will take time no matter what.
  13. Correct, though it is just moving drawers around (had to do that when my tiles got too numerous.) Looking at the image above you may still be able to utilize my system, I'll include a mockup of your example to illustrate: The outside has grid references to help with the visualization. In this setup I would do the following: Drawers 5,6,7,8,11,12 are easy, just standard grid references: A4, B4, C4, D4, E4, F4. Drawers 1,2,3,4,10 not too much different, with these I would just combine the letters: ABCD1, ABCD2, AB3, CD3, EF3. Now with 9 and 13, I had not come across this setup but I would go with something like EF1-2, GH1-4. This way you keep consistent with the grid system. Now that one breaks down when you have something like this: In this case I break it into 3rds with cols A&B, D&E units of 4 rows, and C a unit of 3 rows. ( I have one of these and it can get a bit confusing. Of course you dont have to go with a grid system, just supply each Drawer with a "name", could be s simple as "A" or "1" All that really matters is it makes sense to you and you will still know what Bin the item is in.
  14. I can understand that. With that being the case, as you initially stated this may not be for you. Heck any software based system may not meet your needs.
  15. Well, it sounds like my system would still be of use to you. Essentially what I call a Bin, is just a large grouping of Drawers, and a drawer is what you would contain 1 or more elements organised however you like. For example I use something like this: for small to medium elements, sometimes splitting them up via color, in this case it would be named something like Bin: 11, with Drawers: A1, A2, A3,..., D5, D6. where the letter is the column and the number the row. Though really you could call in Bin: Tiles; Drawer 1X1, 1X2, 1X3, etc... For larger items I went with something like: For me it would be listed as Bin: 01; Drawers: A1, A2, A3, and A4 Then I have also used old Twizzlers containers: These I just name the Bin: Bionical Bin, I keep items in it sorted in baggies. I hope this helps people to understand my approach, but really when it comes to storage you can name it what ever makes the most sense to you, the database can handle pretty much anything, except maybe apostrophes ( ' ), I don't remember if I properly handled those. Also the Storage for each element can be reassigned as needed at any time. On a side note those Raaco units look great, But I am unsure of the ones you are talking about specifically, maybe an image would help.
  16. I just realized I had a limited country availability set up, so it is now also open world wide. It seems also a bug went past me, for sets that have subsets such as the Advent Calendars, it is calculating the total amount of parts incorrectly. This will be fixed in the next release.
  17. Thanks for the feedback, this is what I was looking for. My goal here is to make it universally usefull. One of the things I was planning on later was a label system. So how do you set up your inventory system? What changes (other then labeling) would make it usefully to you? It is currently set up so that you can enter any single or 2 values for each system. I use a number and grid system my self, with a few descriptors thrown in. For example bin 05 drawer A3 house my 2x3 bricks, and I have my Bionical bin (no drawer) for an assortment of Bionical pieces.
  18. Well, I have now opened Reinstructable to Beta testing with its latest update: What's New: Revised the Database structure. (This will cause all the data to be lost) Added in the ability to restore the database from this point Added the ability to choose more searched items for example if you enter 3731, you can load either just the Pumpkin pack, or the 3D Pumpkin Pack. I notice that while a few users have viewed the thread, only 1 or 2 have downloaded the app. I was hopeing for more intrest. Once again if you want to opt in you can go to: https://play.google.com/apps/testing/com.coding.dragmas.reinstructable Thank you.
  19. I would like to apologise to the 1 or 2 of you that have joined the alpha, but the apps database is going to be changing and unfortunately that means your data will be lost. On the positive side I am implementing a method that archives the database and will allow you to import it after these types of issues are encountered.
  20. I am happy to announce that the App I have been working off and on for years (through many design revisions and corruptions) is finally going Alpha. Reinstructable, takes the sets you own and allows you to indicate where each element is in your collection, whether or not you have you collection organised. It can be in any amount of containers, from 1 to 1,000,000. Current features: Load any set from the standard LEGO catalog as seen here. You can use just the set number but it will choose the first set in the series if the set has sub-sets listed it will include those but will not show them on the Set page (the Elements Page is another story) Load all elements included with the sets load images associated with sets and elements, these are kept in cache so they are loaded only once assign locations to each element, this is available in a batch mode so the user can assign more then one element to the same location. sort elements by location, category, or color. Future Features: Link your Rebrickable account to the app. App database backup. Set Breakout, where you will be able to breakdown the set how ever you want: page? sure step? why not. Sub Build? go nuts. Picture upload. In case there is not an image associated at the time, or you want to do your own (a must for the Set Breakouts) MOC upload, since it will keep track of the elements you have you will be able to generate your own MOC, and possibly upload it here. More as I think of them. The Alpha is open to everyone. I do plan on having 2 versions eventually, one ad supported, and the other available for a one time charge (not sure what yet.) You may find the opt in here: https://play.google.com/apps/testing/com.coding.dragmas.reinstructable. And no, at this time there is no plan on releasing an IOS version.
  21. I may be able to assist. I had a similar problem I will post my code and try to walk you throu it, though it is quite normalized to be able to be used in many situations. I am also using VS 2017 with Xamarin and RestSharp public class Props { public enum MethodType { GET, POST, PUT } public string BaseUrl { get; set; } public string UserName { get; set; } public string PassWord { get; set; } public string URL { get; set; } public MethodType Method { get; set; } public StringContent String_Content { get { User u = new User(); string jObject = JsonConvert.SerializeObject(u); var stringContent = new StringContent(jObject.ToString() , System.Text.Encoding.UTF8 , "application/json" ); return stringContent; } } class User { public string username = UserName; public string password = PassWord; } } public async Task GetUserToken(string userName, string passWord) { var baseUrl = "https://rebrickable.com/api/v3/users/_token/?{key}"; var key = "(your apiKey)"; var props = new Props() { UserName = userName, PassWord = passWord, Method = Props.MethodType.POST, URL = baseUrl.Replace("{key}", key); }; props.URL = Constants.baseUrl + props.BaseUrl.Replace("{key}", key); JObject obj = await GetObjects(props); var token = obj["user_token"].ToString(); } private async Task<JObject> GetObjects(Props props) { var resultsObj = new JObject(); var jsonDoc = await FetchAsync(props); var objects = JObject.Parse(jsonDoc); resultsObj = (JObject)objects["results"] ?? (JObject)objects; return resultsObj; } private async Task<String> FetchAsync(Props props) { // Create an HTTP web request using the URL: using (var client = new HttpClient()) { // send a GET request var httpClient = GetHttpClient(props.URL); var response = new HttpResponseMessage(); object jObject = null; var postData = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("username", props.UserName), new KeyValuePair<string, string>("password", props.PassWord) }; var content = new FormUrlEncodedContent(postData); response = await httpClient.PostAsync(props.URL, content); if (response.IsSuccessStatusCode) { var content = response.Content; string jsonString = await content.ReadAsStringAsync().ConfigureAwait(false); return jsonString; } } return ""; } This bit of code is the important part: var postData = new List<KeyValuePair<string, string>> { new KeyValuePair<string, string>("username", props.UserName), new KeyValuePair<string, string>("password", props.PassWord) }; var content = new FormUrlEncodedContent(postData); response = await httpClient.PostAsync(props.URL, content); This is what gets your parameters in a readable format that the API can understand.. I did edit my code somewhat so hopefully it will work.
  22. well looks like I got it, this post helped me: https://forums.xamarin.com/discussion/39255/httpclient-post. I was passing my parameters incorrectly.
  23. The thing is I am still fairly new to working with API calls in my coding. I am useing c# in VS2017 with Xamarin to impliment an android app (learning so I have the skills for work as well., I have gotten GET calls to work no problems, that is just building the correct URL to pass through the httpClient.GetAsync method. the Post and Put not only require the URL but a StringContent which I think is where the stringified paramaters go. I know I am doing somethig wrong, just not sure what.
  24. Greetings, I am restarting the app I was attempting to design about a year ago after a hard drive crash. Anyways, in attempting to use the API above running into it returning a response of: 403 Forbidden - you do not have access to operate on the requested item(s) I am sending it in the following format: from c#: URL: https://rebrickable.com/api/v3/users/_token/?key=<myKey> and a StringContent with the paramaters: {"username":"[email protected]","password":"userPassword"} and media type of 'application/json'. code for the call: response = await httpClient.PostAsync(props.URL, props.String_Content); code for props.String_Content: public StringContent String_Content { get { User u = new User(); string jObject = JsonConvert.SerializeObject(u); var stringContent = new StringContent(jObject.ToString(), System.Text.Encoding.ASCII, "application/json"); return stringContent; } } Any ideas? basically trying to allow the user to import their collection into the app, but if I cannot do that I can always just have them enter each set manually, I at least got that part working.
  25. As the title states the top row of buttons are missing in profile mode on a phone browser (chrome). I have attached a screen shot from my phone to show the issue