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

style: move code to src directory #166

Merged
merged 1 commit into from
Jan 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion .github/workflows/update-db.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ on:
- cron: '0 0 * * *' # every day at midnight
workflow_dispatch:

concurrency:
group: "${{ github.workflow }}-${{ github.ref }}"
cancel-in-progress: true

jobs:
update:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,7 +56,7 @@ jobs:
- name: Update
working-directory: gh-pages
run: |
python -u ../update_db.py \
python -u ../src/update_db.py \
--twitch_client_id ${{ secrets.TWITCH_CLIENT_ID }} \
--twitch_client_secret ${{ secrets.TWITCH_CLIENT_SECRET }} \
--youtube_api_key ${{ secrets.YOUTUBE_API_KEY }}
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ Information from YouTube API is also added to the database for videos.
- [ ] Revamp index page
- [ ] Provide an item page for each API item
- [ ] Remove CNAME after next Sunshine release (> v0.23.1)
- [ ] Move python code to `src` directory
- [x] Move python code to `src` directory
- [ ] Add unit tests
- [ ] Add code coverage
Empty file added src/__init__.py
Empty file.
File renamed without changes.
File renamed without changes.
6 changes: 0 additions & 6 deletions update_db.py → src/update_db.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,19 +279,13 @@ def get_data():
continue

json_result = json.loads(byte_array) # this is a list of dictionaries
# items.extend(json_result)

for item in json_result:
full_dict[end_point][item['id']] = item

# file_path = os.path.join(end_point, str(item['id']))
# write_json_files(file_path=file_path, data=item)

if args.test_mode:
break

# print(json.dumps(json_result, indent=4))

offset += limit

if not json_result:
Expand Down
Loading