Merge branch 'main' into video_file_preview

This commit is contained in:
Neeraj Gupta 2024-11-08 15:52:36 +05:30
commit 58486744e1
8 changed files with 57 additions and 14 deletions

View File

@ -789,6 +789,12 @@
{
"title": "pCloud"
},
{
"title": "PebbleHost",
"altNames": [
"Pebble Host"
]
},
{
"title": "Peerberry"
},
@ -881,6 +887,12 @@
{
"title": "Restorecord"
},
{
"title": "Restream",
"altNames": [
"restream.io"
]
},
{
"title": "Revolt",
"hex": "858585"
@ -1028,6 +1040,13 @@
"tencentcloud"
]
},
{
"title": "Terabit",
"altNames": [
"Terabit Hosting",
"terabit.io"
]
},
{
"title": "Termius",
"hex": "858585"

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="904" height="904">
<path d="M0 0 C1.11288391 0.00060425 2.22576782 0.0012085 3.37237549 0.00183105 C19.19099691 0.02517285 34.84917119 0.19185902 50.5625 2.1875 C52.2007373 2.38883545 52.2007373 2.38883545 53.87207031 2.59423828 C144.11102555 13.92744782 231.51339069 51.17412862 298.98046875 112.8515625 C300.37469497 114.11290483 301.77481127 115.36842668 303.20581055 116.58789062 C309.19714778 121.71020777 314.78307669 127.22194476 320.3527832 132.79248047 C321.98825882 134.42577448 323.63157708 136.0508847 325.27539062 137.67578125 C331.09001224 143.45977566 336.53034336 149.35895875 341.6472168 155.78417969 C343.24543187 157.78963912 344.87613176 159.73578404 346.57421875 161.65625 C405.79203624 228.64193707 442.65605654 320.29719472 449.5625 409.1875 C449.64862549 410.24493408 449.73475098 411.30236816 449.82348633 412.3918457 C450.72419906 424.79729885 450.76142247 437.19135266 450.75 449.625 C450.74959213 451.29133484 450.74959213 451.29133484 450.74917603 452.99133301 C450.73133919 468.81731301 450.48400796 484.46060387 448.5625 500.1875 C448.46598145 501.05342773 448.36946289 501.91935547 448.27001953 502.81152344 C438.14431989 593.02834817 399.26877576 681.47431329 337.8984375 748.60546875 C336.63709517 749.99969497 335.38157332 751.39981127 334.16210938 752.83081055 C329.03979223 758.82214778 323.52805524 764.40807669 317.95751953 769.9777832 C316.32422552 771.61325882 314.6991153 773.25657708 313.07421875 774.90039062 C307.29022434 780.71501224 301.39104125 786.15534336 294.96582031 791.2722168 C292.96036088 792.87043187 291.01421596 794.50113176 289.09375 796.19921875 C222.23274492 855.30681276 130.17937532 892.30230102 41.5625 899.1875 C40.50506592 899.27362549 39.44763184 899.35975098 38.3581543 899.44848633 C25.95279899 900.34919196 13.55857494 900.38745456 1.125 900.375 C0.01211609 900.37439575 -1.10076782 900.3737915 -2.24737549 900.37316895 C-18.06823152 900.34982385 -33.7211673 900.17158591 -49.4375 898.1875 C-50.50838867 898.05859375 -51.57927734 897.9296875 -52.68261719 897.796875 C-144.47214559 886.52218741 -229.08903921 848.15294951 -298.4375 787.1875 C-299.34113281 786.39730469 -300.24476563 785.60710938 -301.17578125 784.79296875 C-307.85140813 778.81292094 -314.22766301 772.52473887 -320.58743286 766.21279907 C-321.59508155 765.21319029 -322.60420601 764.21506645 -323.61495972 763.21859741 C-329.60908412 757.30024829 -335.24089687 751.22111789 -340.48193359 744.61669922 C-342.37137958 742.2696346 -344.34074007 740.0343426 -346.375 737.8125 C-391.43715685 687.50642352 -420.73249017 621.85371633 -437.4375 557.1875 C-437.83966718 555.68354652 -438.24198334 554.17963287 -438.64453125 552.67578125 C-443.69584874 532.77238285 -446.83696415 511.65075455 -448.4375 491.1875 C-448.56668823 489.60352417 -448.56668823 489.60352417 -448.69848633 487.98754883 C-449.59918104 475.58073986 -449.63745601 463.18502073 -449.625 450.75 C-449.62439575 449.63711609 -449.6237915 448.52423218 -449.62316895 447.37762451 C-449.59982385 431.55676848 -449.42158591 415.9038327 -447.4375 400.1875 C-447.30859375 399.11661133 -447.1796875 398.04572266 -447.046875 396.94238281 C-440.4868699 343.53604502 -425.54073226 289.91173527 -399.33984375 242.64453125 C-397.63812667 239.55208851 -396.08334006 236.43385498 -394.5625 233.25 C-381.20876689 206.4333752 -362.4962862 181.56702106 -342.94384766 158.98095703 C-341.8152422 157.63723974 -340.71528861 156.26936853 -339.63037109 154.89013672 C-333.44070728 147.07610164 -326.61041352 140.05423723 -319.54541016 133.03466797 C-317.56568576 131.0656685 -315.59689246 129.08619273 -313.62890625 127.10546875 C-307.25451675 120.7248322 -300.85627204 114.61259775 -293.75146484 109.04223633 C-291.36709203 107.13106516 -289.15330692 105.1029816 -286.9375 103 C-279.31894602 96.05295318 -270.796479 90.19951996 -262.4375 84.1875 C-261.02597656 83.16462891 -261.02597656 83.16462891 -259.5859375 82.12109375 C-229.85439671 60.92076827 -197.38904037 43.55411722 -163.4375 30.1875 C-162.52548828 29.8260791 -161.61347656 29.4646582 -160.67382812 29.09228516 C-122.51432036 14.14110403 -81.30867967 4.38424409 -40.4375 1.1875 C-38.85352417 1.05831177 -38.85352417 1.05831177 -37.23754883 0.92651367 C-24.83073986 0.02581896 -12.43502073 -0.01245601 0 0 Z " fill="#000000" transform="translate(451.4375,1.8125)"/>
<path d="M0 0 C233.85843373 0 233.85843373 0 270 13 C271.20011719 13.42796875 272.40023438 13.8559375 273.63671875 14.296875 C289.44811188 20.27865604 304.081328 28.05350622 317 39 C318.22589844 39.99966797 318.22589844 39.99966797 319.4765625 41.01953125 C344.81574688 62.39674693 356.76928326 95.10294351 359.80371094 127.25927734 C361.0036314 144.01339073 360.22261787 160.53401268 357 177 C356.69255859 178.75957031 356.69255859 178.75957031 356.37890625 180.5546875 C350.99149974 207.92672804 332.75342874 232.71081084 309.8984375 248.17578125 C286.34475375 263 286.34475375 263 279 263 C286.9944143 277.39508684 295.1117491 291.70380211 303.4375 305.91015625 C309.04206461 315.47534172 314.56226164 325.08936946 320.09570312 334.69580078 C322.01506662 338.02614252 323.93682353 341.35509148 325.859375 344.68359375 C331.61613159 354.65143316 337.36365676 364.6239207 343.0625 374.625 C347.84252943 383.01048241 352.69381747 391.3528543 357.56518555 399.68554688 C363.8788019 410.49052519 370.13330951 421.32933469 376.37451172 432.17626953 C377.82175919 434.69036749 379.27175921 437.2028511 380.72265625 439.71484375 C381.4611125 440.99729508 382.19941203 442.27983668 382.9375 443.5625 C383.54464844 444.61566406 384.15179687 445.66882813 384.77734375 446.75390625 C386 449 386 449 386 450 C368.40636948 450.30399394 350.81356086 450.53307186 333.21790314 450.67355824 C325.04736936 450.74053018 316.87846926 450.83178743 308.70898438 450.98071289 C301.58637502 451.1104922 294.46494869 451.19420178 287.34118986 451.22315043 C283.57013155 451.24006961 279.80245662 451.27966279 276.03248596 451.37449074 C272.47889243 451.46314684 268.93005216 451.48988228 265.37545776 451.47039986 C263.45838506 451.47564986 261.54182457 451.54542453 259.62609863 451.61746216 C255.98576831 451.56115318 253.37717104 451.37603377 250 450 C246.45988364 446.00478726 244.28662185 441.83198107 242 437 C241.1754463 435.52668234 240.34184823 434.05826327 239.48828125 432.6015625 C238.76023327 431.2775707 238.03500825 429.95202298 237.3125 428.625 C236.45780129 427.07249249 235.602292 425.52043103 234.74609375 423.96875 C234.07876221 422.75832031 234.07876221 422.75832031 233.39794922 421.5234375 C230.91580094 417.04291277 228.39622559 412.58362075 225.875 408.125 C225.33456055 407.16916016 224.79412109 406.21332031 224.23730469 405.22851562 C219.53151113 396.91776268 214.78647131 388.62956921 210.04129028 380.34127808 C204.08768973 369.93861815 198.21662094 359.49109588 192.37109375 349.02734375 C184.34641457 334.66629451 176.22855735 320.35765384 168.04443359 306.08691406 C167.58633301 305.28737305 167.12823242 304.48783203 166.65625 303.6640625 C166.26244141 302.97779785 165.86863281 302.2915332 165.46289062 301.58447266 C163.2847522 297.73637964 161.14740447 293.86532805 159 290 C149.1 289.67 139.2 289.34 129 289 C129 342.13 129 395.26 129 450 C86.43 450 43.86 450 0 450 C0 301.5 0 153 0 0 Z " fill="#FEFEFE" transform="translate(283,227)"/>
<path d="M0 0 C77.16082803 0 77.16082803 0 93.5234375 14.3515625 C105.35605673 27.56152365 106.80173357 42.68365139 106.15673828 59.62207031 C105.26854826 73.09710268 100.03099568 85.35817152 90.2265625 94.6875 C65.74626402 114.51964054 28.01100936 108 0 108 C0 72.36 0 36.72 0 0 Z " fill="#000000" transform="translate(412,324)"/>
</svg>

After

Width:  |  Height:  |  Size: 7.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -13,11 +13,11 @@ type Entity struct {
DecryptionHeader string `json:"decryptionHeader"`
}
type IndexDiffRequest struct {
LastUpdated int64 `form:"lastUpdated" binding:"required"`
type FDDiffRequest struct {
LastUpdatedAt *int64 `form:"lastUpdated" binding:"required"`
}
type IndexStatus struct {
type FDStatus struct {
FileID int64 `json:"fileID" binding:"required"`
UserID int64 `json:"userID" binding:"required"`
Type ente.ObjectType `json:"type" binding:"required"`

View File

@ -73,17 +73,23 @@ func (h *FileHandler) GetFilesData(ctx *gin.Context) {
// FileDataStatusDiff API won't really return status/diff for deleted files. The clients will primarily use this data to identify for which all files we already have preview generated or it's ML inference is done.
// This doesn't simulate perfect diff behaviour as we won't maintain a tombstone entries for the deleted API.
func (h *FileHandler) FileDataStatusDiff(ctx *gin.Context) {
var req fileData.IndexDiffRequest
var req fileData.FDDiffRequest
if err := ctx.ShouldBindJSON(&req); err != nil {
ctx.JSON(http.StatusBadRequest, ente.NewBadRequestWithMessage(err.Error()))
return
}
resp, err := h.FileDataCtrl.FileDataStatusDiff(ctx, req)
if req.LastUpdatedAt == nil || *req.LastUpdatedAt < 0 {
ctx.JSON(http.StatusBadRequest, ente.NewBadRequestWithMessage("lastUpdated is required and should be greater than or equal to 0"))
return
}
diff, err := h.FileDataCtrl.FileDataStatusDiff(ctx, req)
if err != nil {
handler.Error(ctx, err)
return
}
ctx.JSON(http.StatusOK, resp)
ctx.JSON(http.StatusOK, gin.H{
"diff": diff,
})
}
func (h *FileHandler) GetFileData(ctx *gin.Context) {

View File

@ -303,7 +303,7 @@ func (c *Controller) _validatePermission(ctx *gin.Context, fileID int64, actorID
return nil
}
func (c *Controller) FileDataStatusDiff(ctx *gin.Context, req fileData.IndexDiffRequest) ([]fileData.IndexStatus, error) {
func (c *Controller) FileDataStatusDiff(ctx *gin.Context, req fileData.FDDiffRequest) ([]fileData.FDStatus, error) {
userID := auth.GetUserID(ctx.Request.Header)
return c.Repo.GetIndexStatusForUser(ctx, userID, req.LastUpdated, 5000)
return c.Repo.GetFDForUser(ctx, userID, *req.LastUpdatedAt, 5000)
}

View File

@ -168,7 +168,7 @@ func (r *Repository) RemoveBucket(row filedata.Row, bucketID string, columnName
return nil
}
func (r *Repository) GetIndexStatusForUser(ctx context.Context, userID int64, lastUpdatedAt int64, limit int64) ([]filedata.IndexStatus, error) {
func (r *Repository) GetFDForUser(ctx context.Context, userID int64, lastUpdatedAt int64, limit int64) ([]filedata.FDStatus, error) {
rows, err := r.DB.QueryContext(ctx, `SELECT file_id, user_id, data_type, size, is_deleted, updated_at
FROM file_data
WHERE user_id = $1 AND updated_at > $2 ORDER BY updated_at
@ -176,16 +176,16 @@ func (r *Repository) GetIndexStatusForUser(ctx context.Context, userID int64, la
if err != nil {
return nil, stacktrace.Propagate(err, "")
}
var indexStatuses []filedata.IndexStatus
var fdStatuses []filedata.FDStatus
for rows.Next() {
var indexStatus filedata.IndexStatus
scanErr := rows.Scan(&indexStatus.FileID, &indexStatus.UserID, &indexStatus.Type, &indexStatus.Size, &indexStatus.IsDeleted, &indexStatus.UpdatedAt)
var status filedata.FDStatus
scanErr := rows.Scan(&status.FileID, &status.UserID, &status.Type, &status.Size, &status.IsDeleted, &status.UpdatedAt)
if scanErr != nil {
return nil, stacktrace.Propagate(scanErr, "")
}
indexStatuses = append(indexStatuses, indexStatus)
fdStatuses = append(fdStatuses, status)
}
return indexStatuses, nil
return fdStatuses, nil
}
func (r *Repository) MoveBetweenBuckets(row filedata.Row, bucketID string, sourceColumn string, destColumn string) error {