Skip to content

Commit

Permalink
Fix username for media downloads
Browse files Browse the repository at this point in the history
  • Loading branch information
axsuul committed Nov 20, 2023
1 parent 88370b2 commit ec31dee
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
1 change: 0 additions & 1 deletion .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
- name: Build Docker image tags
run: |
echo 'DOCKER_IMAGE_TAGS<<EOF' >> $GITHUB_ENV
echo "ghcr.io/${{ github.repository }}:${{ github.sha }}" >> $GITHUB_ENV
# Add release tag if it matches pattern (e.g. 0.0.1)
if [[ ${{ github.ref_name }} =~ .+\..+\..+ ]]; then
Expand Down
4 changes: 2 additions & 2 deletions lib/middleware/collector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -119,11 +119,11 @@ def collect_activity_metrics
next unless activity_resource.dig("type") == "media.download"

# The title will be something like "Media download by user123"
user = activity_resource.dig("title").split(/\s+/).last
username = activity_resource.dig("title").split(/\s+/).last

labels = {
user_id: activity_resource.dig("userID"),
user: user,
username: username,
}

values[labels] += 1
Expand Down

0 comments on commit ec31dee

Please sign in to comment.