alist icon indicating copy to clipboard operation
alist copied to clipboard

文件下载计数功能

Open Orange-AFK opened this issue 2 years ago • 7 comments

Please make sure of the following things

  • [X] I have read the documentation.
  • [X] I'm sure there are no duplicate issues or discussions.
  • [X] I'm sure this feature is not implemented.
  • [X] I'm sure it's a reasonable and popular requirement.

Description of the feature / 需求描述

新功能需求

  • 为alist添加一个下载计数的功能
  • 后台挂载的存储中添加一个以下载次数为排序的选项
  • 前端面板为每个文件展示累计的下载次数
  • 前端面板可以展示热门下载的资源

Suggested solution / 实现思路

大概思路

  • 使用chatgpt整理了一下思路以及有一些参考代码,查看我的对话分享:https://chat.openai.com/share/f3b84c4c-dd1c-43fa-ab0d-bbedc4dadd4d
  • 通过修改后端数据库字段实现保存下载计数
  • 修改下载接口逻辑计数下载次数
  • 通过缓存写入下载计数应对高频访问
  • 同一个访问IP在1小时内的重复下载记作一次
  • 计数方式使用唯一标识符追踪
  • 后端新增控制单元,是否展示热门下载资源
  • 修改前端面板展示下载计数和热门资源

Additional context / 附件

博客的文章都会有访问计数,以此展示给访客热门的文章,文件分享网站的下载计数以此展示给访客热门资源

Orange-AFK avatar Dec 08 '23 18:12 Orange-AFK

Thanks for opening your first issue here! Be sure to follow the issue template!

welcome[bot] avatar Dec 08 '23 18:12 welcome[bot]

See

  1. 56% #5304

github-actions[bot] avatar Dec 08 '23 18:12 github-actions[bot]

我认为这个意义不大。。。我倒是自己实现了一个类似的功能 不过这个需求,我感觉,应该是会被无视的 至少我感觉加到alist里,不合理

IAALAI avatar Dec 19 '23 22:12 IAALAI

我认为这个意义不大。。。我倒是自己实现了一个类似的功能 不过这个需求,我感觉,应该是会被无视的 至少我感觉加到alist里,不合理

嗯,一直沒搜到原有的需求,提交以後才發現https://github.com/alist-org/alist/issues/5304已有

Orange-AFK avatar Dec 22 '23 05:12 Orange-AFK

我的做法是日志入库,入库之后可以上查询可以做到类似的功能,也能实现下载类型的统计之类的,得益于数据库的强大,还能查询出某时段内某类型的下载量

IAALAI avatar Dec 22 '23 14:12 IAALAI

我现在还在研究怎么让修改它的日志输出格式,直接导出我想要的东西来减少序列化的负载

IAALAI avatar Dec 22 '23 14:12 IAALAI

支持,希望实现!

hack0573 avatar Jan 19 '24 03:01 hack0573

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] avatar Mar 03 '24 05:03 stale[bot]

Hello @, this issue was closed due to inactive more than 52 days. You can reopen or recreate it if you think it should continue. Thank you for your contributions again.

github-actions[bot] avatar Mar 15 '24 00:03 github-actions[bot]