glensc / python-pytrakt

A Pythonic interface to the Trakt.tv REST API
https://glensc.github.io/python-pytrakt/
Other
20 stars 6 forks source link

Add movies trending and popular functions in movies.py in same format as tv.py #33

Open chrisdma opened 11 months ago

chrisdma commented 11 months ago

Hello,

Not sure how to correctly do a pull request but can you add a popular_movies and update the trending_movies function to the below format from tv.py? It should be fairly easy as the trakt API supports movies/trending?page={page}&limit={limit} and movies/popular?page={page}&limit={limit} just like the below example:

@get
def popular_shows(page=1, limit=10, extended=None):
    uri = 'shows/popular?page={page}&limit={limit}'.format(
        page=page, limit=limit
    )
    if extended:
        uri += '&extended={extended}'.format(extended=extended)

    data = yield uri
    yield [TVShow(**show) for show in data]

@get
def trending_shows(page=1, limit=10, extended=None):
    """All :class:`TVShow`'s being watched right now"""
    uri = 'shows/trending?page={page}&limit={limit}'.format(
        page=page, limit=limit
    )
    if extended:
        uri += '&extended={extended}'.format(extended=extended)

    data = yield uri
    yield [TVShow(**show['show']) for show in data]
glensc commented 8 months ago
  1. find the file in the tree https://github.com/glensc/python-pytrakt
  2. find the edit this file button
  3. make your changes
  4. find the commit changes button
  5. proceed with create pull request

there should be tons of howto's in internet how to do all that, try "make changes to file in github"

edit: here it is with screenshots etc