Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cinema #116

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open

Cinema #116

wants to merge 15 commits into from

Conversation

NT-me
Copy link

@NT-me NT-me commented Jun 15, 2019

What type of change does this PR introduce?

  • Bugfix
  • [X ] Feature
  • Refactor
  • Documentation
  • Not Sure?

Does this PR introduce breaking changes?

  • Yes
  • [X ] No

List any relevant issue numbers:

#107

Description:

This package will be more important than just this little module.
It's actually works :)

Actual features :

  • Recommend movie with an note <5 stars on themoviedb.org

Future features :

  • Great logo with leon color's
  • Give movies in cinema actually and in future
  • Give information about movies
  • Give information about actors/actress/realisator etc...
  • Recommend an serie
  • Recommend series and movies who match with your interest

API use :

db : www.themoviedb.org
with wrapper : https://github.com/celiao/tmdbsimple

@NT-me
Copy link
Author

NT-me commented Jul 17, 2019

v 1.0.0 is out
Tests, readme and features are now useable

@@ -8,5 +8,6 @@ requests = "==2.21.0"
pytube = "==9.5.0"
tinydb = "==3.9.0"
beautifulsoup4 = "==4.7.1"
tmdbsimple = "==2.2.0"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR is quite old, before we merge, we should use the latest versions of the dependencies used in this package.
Currently the latest version of tmdbsimple is 2.8.0.

Copy link
Member

@theoludwig theoludwig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your contribution! @gnouf1

I submit several comments about your code, feel free to discuss.

@@ -0,0 +1,51 @@
# Cinema Package

![](https://media.discordapp.net/attachments/587078058130014240/601166722061434937/cinema.png)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we should use external ressources for images, we should store them ourselves.
Also there is no alt, even if it's only in markdown etc, we should still follow the best practices, and set the alt attributes the thing between [].

import datetime as dt
import json

# Package database
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should avoid using useless comments.

@functools.wraps(func)
def wrapper_load_config(string, entities):
# Init "payload" as dictionary
payload = dict()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I understand, payload is configuration right ?
Maybe we could rename it config or configuration and why do you initialize with dict(), you could simply do like this :

config = {}

Also as said before, we should avoid using useless comments.

import tmdbsimple as tmdb
import functools
import random as ran
import datetime as dt
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are you renaming :

  • tmdbsimple as tmdb
  • random as ran
  • datetime as dt

We should keep the default, it's a lot clearer, and as said, I don't think abbreviations in the code is great.



@load_config
def recommend(payload):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should split this fiunctions in multiple small functions, the code is quite hard to understand if there weren't the comments, but it would be better to make it comprehensible without comments.

now_in_theatres = tmdb.Discover().movie(
primary_release_date=payload["today"],
language=payload["lang"])
res = '<ul>'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe instead of res we could name it result.

@@ -0,0 +1,62 @@
{
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should run prettier in this file, the spaces are not regular, and it isn't really pretty.

@@ -0,0 +1 @@
[{"locale":"af","country":"Afrikaans","string":"Fliek"},{"locale":"ar","country":"Arabic","string":"فيلم"},{"locale":"az","country":"Azerbaijani","string":"film"},{"locale":"be","country":"Belarusian","string":"фільм"},{"locale":"bg","country":"Bulgarian","string":"филм"},{"locale":"bn","country":"Bengali","string":"সিনেমা"},{"locale":"bs","country":"Bosnian","string":"film"},{"locale":"ca","country":"Catalan","string":"pel·lícula"},{"locale":"ceb","country":"Cebuano","string":"movie"},{"locale":"cs","country":"Czech","string":"film"},{"locale":"cy","country":"Welsh","string":"ffilm"},{"locale":"da","country":"Danish","string":"film"},{"locale":"de","country":"German","string":"Film"},{"locale":"el","country":"Greek","string":"ταινία"},{"locale":"en","country":"English","string":"movie"},{"locale":"eo","country":"Esperanto","string":"movie"},{"locale":"es","country":"Spanish","string":"película"},{"locale":"et","country":"Estonian","string":"Film"},{"locale":"eu","country":"Basque","string":"movie"},{"locale":"fa","country":"Persian","string":"فیلم سینما"},{"locale":"fi","country":"Finnish","string":"elokuva"},{"locale":"fr","country":"French","string":"film"},{"locale":"ga","country":"Irish","string":"scannán"},{"locale":"gl","country":"Galician","string":"película"},{"locale":"gu","country":"Gujarati","string":"મૂવી"},{"locale":"ha","country":"Hausa","string":"fim"},{"locale":"hi","country":"Hindi","string":"चलचित्र"},{"locale":"hmn","country":"Hmong","string":"movie"},{"locale":"hr","country":"Croatian","string":"film"},{"locale":"ht","country":"Haitian Creole","string":"fim"},{"locale":"hu","country":"Hungarian","string":"film"},{"locale":"hy","country":"Armenian","string":"ֆիլմը"},{"locale":"id","country":"Indonesian","string":"film"},{"locale":"ig","country":"Igbo","string":"ihe nkiri"},{"locale":"is","country":"Icelandic","string":"bíómynd"},{"locale":"it","country":"Italian","string":"film"},{"locale":"iw","country":"Hebrew","string":"סרט"},{"locale":"ja","country":"Japanese","string":"映画"},{"locale":"jw","country":"Javanese","string":"film"},{"locale":"ka","country":"Georgian","string":"ფილმი"},{"locale":"kk","country":"Kazakh","string":"фильм"},{"locale":"km","country":"Khmer","string":"ខ្សែភាពយន្ត"},{"locale":"kn","country":"Kannada","string":"ಚಲನಚಿತ್ರ"},{"locale":"ko","country":"Korean","string":"영화"},{"locale":"la","country":"Latin","string":"movie"},{"locale":"lo","country":"Lao","string":"ຮູບ​ເງົາ"},{"locale":"lt","country":"Lithuanian","string":"filmas"},{"locale":"lv","country":"Latvian","string":"filmu"},{"locale":"mg","country":"Malagasy","string":"sarimihetsika"},{"locale":"mi","country":"Maori","string":"kiriata"},{"locale":"mk","country":"Macedonian","string":"филм"},{"locale":"ml","country":"Malayalam","string":"സിനിമ"},{"locale":"mn","country":"Mongolian","string":"кино"},{"locale":"mr","country":"Marathi","string":"चित्रपट"},{"locale":"ms","country":"Malay","string":"filem"},{"locale":"mt","country":"Maltese","string":"film"},{"locale":"my","country":"Myanmar (Burmese)","string":"ရုပ်ရှင်"},{"locale":"ne","country":"Nepali","string":"चलचित्र"},{"locale":"nl","country":"Dutch","string":"film"},{"locale":"no","country":"Norwegian","string":"film"},{"locale":"ny","country":"Chichewa","string":"kanema"},{"locale":"pa","country":"Punjabi","string":"ਫਿਲਮ"},{"locale":"pl","country":"Polish","string":"film"},{"locale":"pt","country":"Portuguese","string":"filme"},{"locale":"ro","country":"Romanian","string":"film"},{"locale":"ru","country":"Russian","string":"кино"},{"locale":"si","country":"Sinhala","string":"චිත්රපටය"},{"locale":"sk","country":"Slovak","string":"film"},{"locale":"sl","country":"Slovenian","string":"film"},{"locale":"so","country":"Somali","string":"filim"},{"locale":"sq","country":"Albanian","string":"film"},{"locale":"sr","country":"Serbian","string":"филм"},{"locale":"st","country":"Sesotho","string":"filimi"},{"locale":"su","country":"Sundanese","string":"Pilem"},{"locale":"sv","country":"Swedish","string":"film"},{"locale":"sw","country":"Swahili","string":"movie"},{"locale":"ta","country":"Tamil","string":"திரைப்பட"},{"locale":"te","country":"Telugu","string":"సినిమా"},{"locale":"tg","country":"Tajik","string":"филм"},{"locale":"th","country":"Thai","string":"หนัง"},{"locale":"tl","country":"Filipino","string":"pelikula"},{"locale":"tr","country":"Turkish","string":"film"},{"locale":"uk","country":"Ukrainian","string":"фільм"},{"locale":"ur","country":"Urdu","string":"فلم"},{"locale":"uz","country":"Uzbek","string":"film"},{"locale":"vi","country":"Vietnamese","string":"bộ phim"},{"locale":"yi","country":"Yiddish","string":"פֿילם"},{"locale":"yo","country":"Yoruba","string":"fiimu"},{"locale":"zh","country":"Chinese","string":"电影"},{"locale":"zh-CN","country":"Chinese (Simplified)","string":"电影"},{"locale":"zh-TW","country":"Chinese (Traditional)","string":"電影"},{"locale":"zu","country":"Zulu","string":"movie"}]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same thing as others json files, we should run prettier and I don't it's great, to have the data in one single line, not really readable.

@theoludwig theoludwig added the feature request Indicates new feature requests. label Apr 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Indicates new feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants