Skip to content

Commit

Permalink
style: move code to src directory (#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
ReenigneArcher authored Jan 5, 2025
1 parent bd3fbb9 commit 351555f
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 8 deletions.
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

0 comments on commit 351555f

Please sign in to comment.