Thor77 / TeamspeakStats

A simple Teamspeak stats-generator - based on server-logs
MIT License
19 stars 2 forks source link

Support for a nicer structure for ID maps #12

Closed djmattyg007 closed 7 years ago

djmattyg007 commented 7 years ago

This is a proof of concept for #11 that allows use of a JSON ID map that looks like this:

[
  {
    "primary_id": "1",
    "alternate_ids": ["2", "5", "11"]
  },
  {
    "primary_id": "4",
    "alternate_ids": ["17", "82"]
  }
]

Because of how the code is structured, there's nothing stopping you from using an ID map that looks like this:

[
  {
    "name": "Friend 1",
    "primary_id": "1",
    "alternate_ids": ["2", "5", "11"]
  },
  {
    "name": "Friend 2",
    "primary_id": "4",
    "alternate_ids": ["17", "82"]
  }
]

If you're happy with this implementation, I'll start updating the docs, and add some tests too.

djmattyg007 commented 7 years ago

I rebased my commits against the lastest changes on the master branch, squashed it all down into one commit, and pushed again. Hope it all looks good :)

djmattyg007 commented 7 years ago

I've fixed the name of the test.

Thor77 commented 7 years ago

Thanks for your contribution 🎉